guix.de.texi 904 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156
  1. \input texinfo
  2. @c ===========================================================================
  3. @c
  4. @c This file was generated with po4a. Translate the source file.
  5. @c
  6. @c ===========================================================================
  7. @c -*-texinfo-*-
  8. @c %**start of header
  9. @setfilename guix.de.info
  10. @documentencoding UTF-8
  11. @documentlanguage de
  12. @frenchspacing on
  13. @settitle Referenzhandbuch zu GNU Guix
  14. @c %**end of header
  15. @include version-de.texi
  16. @c Identifier of the OpenPGP key used to sign tarballs and such.
  17. @set OPENPGP-SIGNING-KEY-ID 3CE464558A84FDC69DB40CFB090B11993D9AEBB5
  18. @set KEY-SERVER pool.sks-keyservers.net
  19. @copying
  20. Copyright @copyright{} 2012, 2013, 2014, 2015, 2016, 2017, 2018 Ludovic
  21. Courtès@* Copyright @copyright{} 2013, 2014, 2016 Andreas Enge@* Copyright
  22. @copyright{} 2013 Nikita Karetnikov@* Copyright @copyright{} 2014, 2015,
  23. 2016 Alex Kost@* Copyright @copyright{} 2015, 2016 Mathieu Lirzin@*
  24. Copyright @copyright{} 2014 Pierre-Antoine Rault@* Copyright @copyright{}
  25. 2015 Taylan Ulrich Bayırlı/Kammer@* Copyright @copyright{} 2015, 2016, 2017
  26. Leo Famulari@* Copyright @copyright{} 2015, 2016, 2017, 2018 Ricardo
  27. Wurmus@* Copyright @copyright{} 2016 Ben Woodcroft@* Copyright @copyright{}
  28. 2016, 2017, 2018 Chris Marusich@* Copyright @copyright{} 2016, 2017, 2018
  29. Efraim Flashner@* Copyright @copyright{} 2016 John Darrington@* Copyright
  30. @copyright{} 2016, 2017 Nils Gillmann@* Copyright @copyright{} 2016, 2017,
  31. 2018 Jan Nieuwenhuizen@* Copyright @copyright{} 2016 Julien Lepiller@*
  32. Copyright @copyright{} 2016 Alex ter Weele@* Copyright @copyright{} 2017,
  33. 2018 Clément Lassieur@* Copyright @copyright{} 2017, 2018 Mathieu Othacehe@*
  34. Copyright @copyright{} 2017 Federico Beffa@* Copyright @copyright{} 2017,
  35. 2018 Carlo Zancanaro@* Copyright @copyright{} 2017 Thomas Danckaert@*
  36. Copyright @copyright{} 2017 humanitiesNerd@* Copyright @copyright{} 2017
  37. Christopher Allan Webber@* Copyright @copyright{} 2017, 2018 Marius Bakke@*
  38. Copyright @copyright{} 2017 Hartmut Goebel@* Copyright @copyright{} 2017
  39. Maxim Cournoyer@* Copyright @copyright{} 2017, 2018 Tobias Geerinckx-Rice@*
  40. Copyright @copyright{} 2017 George Clemmer@* Copyright @copyright{} 2017
  41. Andy Wingo@* Copyright @copyright{} 2017, 2018 Arun Isaac@* Copyright
  42. @copyright{} 2017 nee@* Copyright @copyright{} 2018 Rutger Helling@*
  43. Copyright @copyright{} 2018 Oleg Pykhalov@* Copyright @copyright{} 2018 Mike
  44. Gerwitz@* Copyright @copyright{} 2018 Pierre-Antoine Rouby@* Copyright
  45. @copyright{} 2018 Gábor Boskovits@* Copyright @copyright{} 2018 Florian
  46. Pelz@* Copyright @copyright{} 2018 Laura Lazzati@* Copyright @copyright{}
  47. 2018 Alex Vong@*
  48. Es ist Ihnen gestattet, dieses Dokument zu vervielfältigen, weiterzugeben
  49. und/oder zu verändern, unter den Bedingungen der GNU Free Documentation
  50. License, entweder gemäß Version 1.3 der Lizenz oder (nach Ihrer Option)
  51. einer späteren Version, die von der Free Software Foundation veröffentlicht
  52. wurde, ohne unveränderliche Abschnitte, ohne vorderen Umschlagtext und ohne
  53. hinteren Umschlagtext. Eine Kopie der Lizenz finden Sie im Abschnitt mit dem
  54. Titel »GNU Free Documentation License«.
  55. @end copying
  56. @dircategory Systemadministration
  57. @direntry
  58. * Guix: (guix.de). Installierte Software und Systemkonfigurationen
  59. verwalten.
  60. * guix package: (guix.de)guix package aufrufen. Pakete installieren,
  61. entfernen und
  62. aktualisieren.
  63. * guix gc: (guix.de)guix gc aufrufen. Unbenutzten Plattenspeicher wieder
  64. freigeben.
  65. * guix pull: (guix.de)guix pull aufrufen. Die Liste verfügbarer Pakete
  66. aktualisieren.
  67. * guix system: (guix.de)guix system aufrufen. Die
  68. Betriebssystemkonfiguration
  69. verwalten.
  70. @end direntry
  71. @dircategory Softwareentwicklung
  72. @direntry
  73. * guix environment: (guix.de)guix environment aufrufen. Umgebungen für
  74. Entwickler
  75. erstellen
  76. * guix build: (guix.de)guix build aufrufen. Erstellen von Paketen.
  77. * guix pack: (guix.de)guix pack aufrufen. Bündel aus Binärdateien
  78. erstellen.
  79. @end direntry
  80. @titlepage
  81. @title Referenzhandbuch zu GNU Guix
  82. @subtitle Den funktionalen Paketmanager GNU Guix benutzen
  83. @author Die GNU-Guix-Entwickler
  84. @page
  85. @vskip 0pt plus 1filll
  86. Edition @value{EDITION} @* @value{UPDATED} @*
  87. @insertcopying
  88. @end titlepage
  89. @contents
  90. @c *********************************************************************
  91. @node Top
  92. @top GNU Guix
  93. Dieses Dokument beschreibt GNU Guix, Version @value{VERSION}, ein
  94. funktionales Paketverwaltungswerkzeug, das für das GNU-System geschrieben
  95. wurde.
  96. @c TRANSLATORS: You can replace the following paragraph with information on
  97. @c how to join your own translation team and how to report issues with the
  98. @c translation.
  99. This manual is also available in French (@pxref{Top,,, guix.fr, Manuel de
  100. référence de GNU Guix}) and German (@pxref{Top,,, guix.de, Referenzhandbuch
  101. zu GNU Guix}). If you would like to translate it in your native language,
  102. consider joining the
  103. @uref{https://translationproject.org/domain/guix-manual.html, Translation
  104. Project}.
  105. @menu
  106. * Einführung:: Was ist Guix überhaupt?
  107. * Installation:: Guix installieren.
  108. * Paketverwaltung:: Pakete installieren, aktualisieren usw.
  109. * Programmierschnittstelle:: Guix in Scheme verwenden.
  110. * Zubehör:: Befehle zur Paketverwaltung.
  111. * GNU-Distribution:: Software für Ihr freundliches GNU-System.
  112. * Mitwirken:: Ihre Hilfe ist nötig!
  113. * Danksagungen:: Danke!
  114. * GNU-Lizenz für freie Dokumentation:: Die Lizenz dieses Handbuchs.
  115. * Konzeptverzeichnis:: Konzepte.
  116. * Programmierverzeichnis:: Datentypen, Funktionen und Variable.
  117. @detailmenu
  118. --- Detaillierte Liste der Knoten ---
  119. Installation
  120. * Aus Binärdatei installieren:: Guix installieren, ohne Zeit zu verlieren!
  121. * Voraussetzungen:: Zum Erstellen und Benutzen von Guix nötige
  122. Software.
  123. * Die Testsuite laufen lassen:: Guix testen.
  124. * Den Daemon einrichten:: Wie man die Umgebung des Erstellungs-Daemons
  125. einrichtet.
  126. * Aufruf des guix-daemon:: Den Erstellungs-Daemon laufen lassen.
  127. * Anwendungen einrichten:: Anwendungsspezifische Einstellungen.
  128. Den Daemon einrichten
  129. * Einrichten der Erstellungsumgebung:: Die isolierte Umgebung zum Erstellen
  130. vorbereiten.
  131. * Auslagern des Daemons einrichten:: Erstellungen auf entfernte Maschinen
  132. auslagern.
  133. * SELinux-Unterstützung:: Wie man eine SELinux-Richtlinie für den Daemon
  134. einrichtet.
  135. Paketverwaltung
  136. * Funktionalitäten:: Wie Guix Ihr Leben schöner machen wird.
  137. * Aufruf von guix package:: Pakete installieren, entfernen usw.
  138. * Substitute:: Vorerstelle Binärdateien herunterladen.
  139. * Pakete mit mehreren Ausgaben.:: Ein Quellpaket, mehrere Ausgaben.
  140. * Aufruf von guix gc:: Den Müllsammler laufen lassen.
  141. * Aufruf von guix pull:: Das neueste Guix samt Distribution laden.
  142. * Channels:: Customizing the package collection.
  143. * Inferiors:: Interacting with another revision of Guix.
  144. * Invoking guix describe:: Display information about your Guix revision.
  145. * Aufruf von guix pack:: Software-Bündel erstellen.
  146. * Aufruf von guix archive:: Import und Export von Store-Dateien.
  147. Substitute
  148. * Offizieller Substitut-Server:: Eine besondere Quelle von Substituten.
  149. * Substitut-Server autorisieren:: Wie man Substitute an- und abschaltet.
  150. * Substitutauthentifizierung:: Wie Guix Substitute verifiziert.
  151. * Proxy-Einstellungen:: Wie Sie Substitute über einen Proxy beziehen.
  152. * Fehler bei der Substitution:: Was passiert, wenn die Substitution
  153. fehlschlägt.
  154. * Vom Vertrauen gegenüber Binärdateien:: Wie können Sie diesem binären
  155. Blob trauen?
  156. Programmierschnittstelle
  157. * Pakete definieren:: Wie Sie neue Pakete definieren.
  158. * Erstellungssysteme:: Angeben, wie Pakete erstellt werden.
  159. * Der Store:: Den Paket-Store verändern.
  160. * Ableitungen:: Systemnahe Schnittstelle für Paketableitungen.
  161. * Die Store-Monade:: Rein funktionale Schnittstelle zum Store.
  162. * G-Ausdrücke:: Erstellungsausdrücke verarbeiten.
  163. * Invoking guix repl:: Fiddling with Guix interactively.
  164. Pakete definieren
  165. * „package“-Referenz:: Der Datentyp für Pakete.
  166. * „origin“-Referenz:: Datentyp für Paketursprünge.
  167. Zubehör
  168. * Aufruf von guix build:: Pakete aus der Befehlszeile heraus erstellen.
  169. * Aufruf von guix edit:: Paketdefinitionen bearbeiten.
  170. * Aufruf von guix download:: Herunterladen einer Datei und Ausgabe ihres
  171. Hashes.
  172. * Aufruf von guix hash:: Den kryptographischen Hash einer Datei
  173. berechnen.
  174. * Aufruf von guix import:: Paketdefinitionen importieren.
  175. * Aufruf von guix refresh:: Paketdefinitionen aktualisieren.
  176. * Aufruf von guix lint:: Fehler in Paketdefinitionen finden.
  177. * Aufruf von guix size:: Plattenverbrauch profilieren.
  178. * Aufruf von guix graph:: Den Paketgraphen visualisieren.
  179. * Aufruf von guix environment:: Entwicklungsumgebungen einrichten.
  180. * Aufruf von guix publish:: Substitute teilen.
  181. * Aufruf von guix challenge:: Die Substitut-Server anfechten.
  182. * Aufruf von guix copy:: Mit einem entfernten Store Dateien austauschen.
  183. * Aufruf von guix container:: Prozesse isolieren.
  184. * Aufruf von guix weather:: Die Verfügbarkeit von Substituten
  185. einschätzen.
  186. * Invoking guix processes:: Listing client processes.
  187. Aufruf von @command{guix build}
  188. * Gemeinsame Erstellungsoptionen:: Erstellungsoptionen für die meisten
  189. Befehle.
  190. * Paketumwandlungsoptionen:: Varianten von Paketen erzeugen.
  191. * Zusätzliche Erstellungsoptionen:: Optionen spezifisch für »guix
  192. build«.
  193. * Fehlschläge beim Erstellen untersuchen:: Praxiserfahrung bei der
  194. Paketerstellung.
  195. GNU-Distribution
  196. * Systeminstallation:: Das ganze Betriebssystem installieren.
  197. * Systemkonfiguration:: Das Betriebssystem konfigurieren.
  198. * Dokumentation:: Wie man Nutzerhandbücher von Software liest.
  199. * Dateien zur Fehlersuche installieren:: Womit man seinen Debugger
  200. füttert.
  201. * Sicherheitsaktualisierungen:: Sicherheits-Patches schnell einspielen.
  202. * Paketmodule:: Pakete aus Sicht des Programmierers.
  203. * Paketrichtlinien:: Die Distribution wachsen lassen.
  204. * Bootstrapping:: GNU/Linux von Grund auf selbst erstellen.
  205. * Portierung:: Guix auf andere Plattformen und Kernels
  206. bringen.
  207. Systeminstallation
  208. * Einschränkungen:: Was Sie erwarten dürfen.
  209. * Hardware-Überlegungen:: Unterstützte Hardware.
  210. * Installation von USB-Stick oder DVD:: Das Installationsmedium
  211. vorbereiten.
  212. * Vor der Installation:: Netzwerkanbindung, Partitionierung etc.
  213. * Fortfahren mit der Installation:: Die Hauptsache.
  214. * GuixSD in einer VM installieren:: Ein GuixSD-Spielplatz.
  215. * Ein Abbild zur Installation erstellen:: Wie ein solches entsteht.
  216. Systemkonfiguration
  217. * Das Konfigurationssystem nutzen:: Ihr GNU-System anpassen.
  218. * „operating-system“-Referenz:: Details der
  219. Betriebssystem-Deklarationen.
  220. * Dateisysteme:: Die Dateisystemeinbindungen konfigurieren.
  221. * Abgebildete Geräte:: Näheres zu blockorientierten Speichermedien.
  222. * Benutzerkonten:: Benutzerkonten festlegen.
  223. * Locales:: Sprache und kulturelle Konventionen.
  224. * Dienste:: Systemdienste festlegen.
  225. * Setuid-Programme:: Mit Administratorrechten startende Programme.
  226. * X.509-Zertifikate:: HTTPS-Server authentifizieren.
  227. * Name Service Switch:: Den Name Service Switch von libc konfigurieren.
  228. * Initiale RAM-Disk:: Linux-libre hochfahren.
  229. * Bootloader-Konfiguration:: Den Bootloader konfigurieren.
  230. * Aufruf von guix system:: Instanzierung einer Systemkonfiguration.
  231. * GuixSD in einer VM starten:: Wie man GuixSD in einer virtuellen Maschine
  232. startet.
  233. * Dienste definieren:: Neue Dienstdefinitionen hinzufügen.
  234. Dienste
  235. * Basisdienste:: Essenzielle Systemdienste.
  236. * Geplante Auftragsausführung:: Der mcron-Dienst.
  237. * Log-Rotation:: Der rottlog-Dienst.
  238. * Netzwerkdienste:: Netzwerkeinrichtung, SSH-Daemon etc.
  239. * X Window:: Graphische Anzeige.
  240. * Druckdienste:: Unterstützung für lokale und entfernte
  241. Drucker.
  242. * Desktop-Dienste:: D-Bus- und Desktop-Dienste.
  243. * Sound Services:: ALSA and Pulseaudio services.
  244. * Datenbankdienste:: SQL-Datenbanken, Schlüssel-Wert-Speicher etc.
  245. * Mail-Dienste:: IMAP, POP3, SMTP und so weiter.
  246. * Kurznachrichtendienste:: Dienste für Kurznachrichten.
  247. * Telefondienste:: Telefoniedienste.
  248. * Überwachungsdienste:: Dienste zur Systemüberwachung.
  249. * Kerberos-Dienste:: Kerberos-Dienste.
  250. * Web-Dienste:: Web-Server.
  251. * Zertifikatsdienste:: TLS-Zertifikate via Let’s Encrypt.
  252. * DNS-Dienste:: DNS-Daemons.
  253. * VPN-Dienste:: VPN-Daemons.
  254. * Network File System:: Dienste mit Bezug zum Netzwerkdateisystem.
  255. * Kontinuierliche Integration:: Der Cuirass-Dienst.
  256. * Power Management Services:: Extending battery life.
  257. * Audio-Dienste:: Der MPD.
  258. * Virtualisierungsdienste:: Dienste für virtuelle Maschinen.
  259. * Versionskontrolldienste:: Entfernten Zugang zu Git-Repositorys bieten.
  260. * Spieldienste:: Spielserver.
  261. * Verschiedene Dienste:: Andere Dienste.
  262. Dienste definieren
  263. * Dienstkompositionen:: Wie Dienste zusammengestellt werden.
  264. * Diensttypen und Dienste:: Typen und Dienste.
  265. * Service-Referenz:: Referenz zur Programmierschnittstelle.
  266. * Shepherd-Dienste:: Eine spezielle Art von Dienst.
  267. Paketrichtlinien
  268. * Software-Freiheit:: Was in die Distribution aufgenommen werden
  269. darf.
  270. * Paketbenennung:: Was macht einen Namen aus?
  271. * Versionsnummern:: Wenn der Name noch nicht genug ist.
  272. * Zusammenfassungen und Beschreibungen:: Den Nutzern helfen, das richtige
  273. Paket zu finden.
  274. * Python-Module:: Ein Touch britischer Comedy.
  275. * Perl-Module:: Kleine Perlen.
  276. * Java-Pakete:: Kaffeepause.
  277. * Schriftarten:: Schriften verschriftlicht.
  278. Mitwirken
  279. * Erstellung aus dem Git:: Das Neueste und Beste.
  280. * Guix vor der Installation ausführen:: Hacker-Tricks.
  281. * Perfekt eingerichtet:: Die richtigen Werkzeuge.
  282. * Code-Stil:: Wie Mitwirkende hygienisch arbeiten.
  283. * Einreichen von Patches:: Teilen Sie Ihre Arbeit.
  284. Code-Stil
  285. * Programmierparadigmen:: Wie Sie Ihre Elemente zusammenstellen.
  286. * Module:: Wo Sie Ihren Code unterbringen.
  287. * Datentypen und Mustervergleich:: Implementierung von Datenstrukturen.
  288. * Formatierung von Code:: Schreibkonventionen.
  289. @end detailmenu
  290. @end menu
  291. @c *********************************************************************
  292. @node Einführung
  293. @chapter Einführung
  294. @cindex Zweck
  295. GNU Guix@footnote{»Guix« wird wie »geeks« ausgesprochen, also als »ɡiːks« in
  296. der Notation des Internationalen Phonetischen Alphabets (IPA).} ist ein
  297. Werkzeug zur Paketverwaltung für das GNU-System. Guix macht es
  298. unprivilegierten Nutzern leicht, Pakete zu installieren, zu aktualisieren
  299. oder zu entfernen, zu einem vorherigen Satz von Paketen zurückzuwechseln,
  300. Pakete aus ihrem Quellcode heraus zu erstellen und hilft allgemein bei der
  301. Schöpfung und Wartung von Software-Umgebungen.
  302. @cindex Benutzeroberflächen
  303. Guix bietet eine befehlszeilenbasierte Paketverwaltungsschnittstelle
  304. (@pxref{Aufruf von guix package}), einen Satz Befehlszeilenwerkzeuge
  305. (@pxref{Zubehör}) sowie Schnittstellen zur Programmierung in Scheme
  306. (@pxref{Programmierschnittstelle}).
  307. @cindex Erstellungs-Daemon
  308. Der @dfn{Erstellungs-Daemon} ist für das Erstellen von Paketen im Auftrag
  309. von Nutzern verantwortlich (@pxref{Den Daemon einrichten}) und für das
  310. Herunterladen vorerstellter Binärdateien aus autorisierten Quellen
  311. (@pxref{Substitute}).
  312. @cindex Erweiterbarkeit der Distribution
  313. @cindex Anpassung, von Paketen
  314. Guix enthält Paketdefinitionen für viele Pakete, von GNU und nicht von GNU,
  315. die alle @uref{https://www.gnu.org/philosophy/free-sw.html, die Freiheit des
  316. Computernutzers respektieren}. Es ist @emph{erweiterbar}: Nutzer können ihre
  317. eigenen Paketdefinitionen schreiben (@pxref{Pakete definieren}) und sie als
  318. unabhängige Paketmodule verfügbar machen (@pxref{Paketmodule}). Es ist
  319. auch @emph{anpassbar}: Nutzer können spezialisierte Paketdefinitionen aus
  320. bestehenden @emph{ableiten}, auch von der Befehlszeile (@pxref{Paketumwandlungsoptionen}).
  321. @cindex Guix System Distribution
  322. @cindex GuixSD
  323. Sie können GNU@tie{}Guix auf ein bestehendes GNU/Linux-System aufsetzen, wo
  324. es die bereits verfügbaren Werkzeuge ergänzt, ohne zu stören
  325. (@pxref{Installation}), oder Sie können es eigenständig als Teil der
  326. @dfn{Guix System Distribution}, kurz GuixSD (@pxref{GNU-Distribution}),
  327. verwenden. Mit GNU@tie{}GuixSD @emph{deklarieren} Sie alle Aspekte der
  328. Betriebssystemkonfiguration und Guix kümmert sich darum, die Konfiguration
  329. auf transaktionsbasierte, reproduzierbare und zustandslose Weise zu
  330. instanzieren (@pxref{Systemkonfiguration}).
  331. @cindex funktionale Paketverwaltung
  332. @cindex isolation
  333. Intern implementiert Guix die Disziplin der @dfn{funktionalen
  334. Paketverwaltung}, zu der Nix schon die Pionierarbeit geleistet hat
  335. (@pxref{Danksagungen}). In Guix wird der Prozess, ein Paket zu erstellen
  336. und zu installieren, als eine @emph{Funktion} im mathematischen Sinn
  337. aufgefasst. Diese Funktion hat Eingaben, wie zum Beispiel
  338. Erstellungs-Skripts, einen Compiler und Bibliotheken, und liefert ein
  339. installiertes Paket. Als eine reine Funktion hängt sein Ergebnis allein von
  340. seinen Eingaben ab — zum Beispiel kann er nicht auf Software oder Skripts
  341. Bezug nehmen, die nicht ausdrücklich als Eingaben übergeben wurden. Eine
  342. Erstellungsfunktion führt immer zum selben Ergebnis, wenn ihr die gleiche
  343. Menge an Eingaben übergeben wurde. Sie kann die Umgebung des laufenden
  344. Systems auf keine Weise beeinflussen, zum Beispiel kann sie keine Dateien
  345. außerhalb ihrer Erstellungs- und Installationsverzeichnisse verändern. Um
  346. dies zu erreichen, laufen Erstellungsprozesse in isolieren Umgebungen
  347. (sogenannte @dfn{Container}), wo nur ausdrückliche Eingaben sichtbar sind.
  348. @cindex Store
  349. Das Ergebnis von Paketerstellungsfunktionen wird im Dateisystem
  350. @dfn{zwischengespeichert} in einem besonderen Verzeichnis, was als @dfn{der
  351. Store} bezeichnet wird (@pxref{Der Store}). Jedes Paket wird in sein eigenes
  352. Verzeichnis im Store installiert — standardmäßig ist er unter
  353. @file{/gnu/store} zu finden. Der Verzeichnisname enthält einen Hash aller
  354. Eingaben, anhand derer das Paket erzeugt wurde, somit hat das Ändern einer
  355. Eingabe einen völlig anderen Verzeichnisnamen zur Folge.
  356. Dieses Vorgehen ist die Grundlage für die Guix auszeichnenden
  357. Funktionalitäten: Unterstützung transaktionsbasierter Paketaktualisierungen
  358. und -rückstufungen, Installation von Paketen als einfacher Nutzer sowie
  359. Garbage Collection für Pakete (@pxref{Funktionalitäten}).
  360. @c *********************************************************************
  361. @node Installation
  362. @chapter Installation
  363. @cindex Guix installieren
  364. @cindex official website
  365. GNU Guix kann von seiner Webseite unter
  366. @url{http://www.gnu.org/software/guix/} heruntergeladen werden. Dieser
  367. Abschnitt beschreibt die Software-Voraussetzungen von Guix und wie man es
  368. installiert, so dass man es benutzen kann.
  369. Beachten Sie, dass es in diesem Abschnitt um die Installation des
  370. Paketverwaltungswerkzeugs geht, welche auf einem laufenden GNU/Linux-System
  371. vollzogen werden kann. Falls Sie stattdessen das vollständige
  372. GNU-Betriebssystem installieren möchten, werfen Sie einen Blick in den
  373. Abschnitt @pxref{Systeminstallation}.
  374. @cindex Fremddistribution
  375. @cindex directories related to foreign distro
  376. Wenn es auf ein bestehendes GNU/Linux-System installiert wird — im Folgenden
  377. als @dfn{Fremddistribution} bezeichnet —, ergänzt GNU@tie{}Guix die
  378. verfügbaren Werkzeuge, ohne dass sie sich gegenseitig stören. Guix’ Daten
  379. befinden sich ausschließlich in zwei Verzeichnissen, üblicherweise
  380. @file{/gnu/store} und @file{/var/guix}; andere Dateien auf Ihrem System wie
  381. @file{/etc} bleiben unberührt.
  382. Sobald es installiert ist, kann Guix durch Ausführen von @command{guix pull}
  383. aktualisiert werden (@pxref{Aufruf von guix pull}).
  384. @menu
  385. * Aus Binärdatei installieren:: Guix installieren, ohne Zeit zu verlieren!
  386. * Voraussetzungen:: Zum Erstellen und Benutzen von Guix nötige
  387. Software.
  388. * Die Testsuite laufen lassen:: Guix testen.
  389. * Den Daemon einrichten:: Wie man die Umgebung des Erstellungs-Daemons
  390. einrichtet.
  391. * Aufruf des guix-daemon:: Den Erstellungs-Daemon laufen lassen.
  392. * Anwendungen einrichten:: Anwendungsspezifische Einstellungen.
  393. @end menu
  394. @node Aus Binärdatei installieren
  395. @section Aus Binärdatei installieren
  396. @cindex Guix aus Binärdateien installieren
  397. @cindex installer script
  398. Dieser Abschnitt beschreibt, wie sich Guix auf einem beliebigen System aus
  399. einem alle Komponenten umfassenden Tarball installieren lässt, der
  400. Binärdateien für Guix und all seine Abhängigkeiten liefert. Dies geht in der
  401. Regel schneller, als Guix aus seinen Quelldateien zu installieren, was in
  402. den nächsten Abschnitten beschrieben wird. Vorausgesetzt wird hier
  403. lediglich, dass GNU@tie{}tar und Xz verfügbar sind.
  404. Wir bieten ein
  405. @uref{https://git.savannah.gnu.org/cgit/guix.git/plain/etc/guix-install.sh,
  406. Installations-Skript für die Shell}, welches Guix automatisch herunterlädt,
  407. installiert und eine erste Konfiguration von Guix mit sich bringt. Es sollte
  408. als der Administratornutzer (als »root«) ausgeführt werden.
  409. Die Installation läuft so ab:
  410. @enumerate
  411. @item
  412. @cindex Guix-Binärdatei herunterladen
  413. Download the binary tarball from
  414. @indicateurl{https://alpha.gnu.org/gnu/guix/guix-binary-@value{VERSION}.@var{system}.tar.xz},
  415. where @var{system} is @code{x86_64-linux} for an @code{x86_64} machine
  416. already running the kernel Linux, and so on.
  417. @c The following is somewhat duplicated in ``System Installation''.
  418. Achten Sie darauf, auch die zugehörige @file{.sig}-Datei herunterzuladen und
  419. verifizieren Sie damit die Authentizität des Tarballs, ungefähr so:
  420. @example
  421. $ wget https://alpha.gnu.org/gnu/guix/guix-binary-@value{VERSION}.@var{system}.tar.xz.sig
  422. $ gpg --verify guix-binary-@value{VERSION}.@var{system}.tar.xz.sig
  423. @end example
  424. Falls dieser Befehl fehlschlägt, weil Sie nicht über den nötigen
  425. öffentlichen Schlüssel verfügen, können Sie ihn mit diesem Befehl
  426. importieren:
  427. @example
  428. $ gpg --keyserver @value{KEY-SERVER} \
  429. --recv-keys @value{OPENPGP-SIGNING-KEY-ID}
  430. @end example
  431. @noindent
  432. @c end authentication part
  433. und den Befehl @code{gpg --verify} erneut ausführen.
  434. @item
  435. Nun müssen Sie zum Administratornutzer @code{root} wechseln. Abhängig von
  436. Ihrer Distribution müssen Sie dazu etwa @code{su -} oder @code{sudo -i}
  437. ausführen. Danach führen Sie als @code{root}-Nutzer aus:
  438. @example
  439. # cd /tmp
  440. # tar --warning=no-timestamp -xf \
  441. guix-binary-@value{VERSION}.@var{system}.tar.xz
  442. # mv var/guix /var/ && mv gnu /
  443. @end example
  444. Dadurch wird @file{/gnu/store} (@pxref{Der Store}) und @file{/var/guix}
  445. erzeugt. Letzteres enthält ein fertiges Guix-Profil für den
  446. Administratornutzer @code{root} (wie im nächsten Schritt beschrieben).
  447. Entpacken Sie den Tarball @emph{nicht} auf einem schon funktionierenden
  448. Guix-System, denn es würde seine eigenen essenziellen Dateien überschreiben.
  449. Die Befehlszeilenoption @code{--warning=no-timestamp} stellt sicher, dass
  450. GNU@tie{}tar nicht vor »unplausibel alten Zeitstempeln« warnt (solche
  451. Warnungen traten bei GNU@tie{}tar 1.26 und älter auf, neue Versionen machen
  452. keine Probleme). Sie treten auf, weil alle Dateien im Archiv als
  453. Änderungszeitpunkt null eingetragen bekommen haben (das bezeichnet den
  454. 1. Januar 1970). Das ist Absicht, damit der Inhalt des Archivs nicht davon
  455. abhängt, wann es erstellt wurde, und es somit reproduzierbar wird.
  456. @item
  457. Make the profile available under @file{~root/.config/guix/current}, which is
  458. where @command{guix pull} will install updates (@pxref{Aufruf von guix pull}):
  459. @example
  460. # mkdir -p ~root/.config/guix
  461. # ln -sf /var/guix/profiles/per-user/root/current-guix \
  462. ~root/.config/guix/current
  463. @end example
  464. »Sourcen« Sie @file{etc/profile}, um @code{PATH} und andere relevante
  465. Umgebungsvariable zu ergänzen:
  466. @example
  467. # GUIX_PROFILE="`echo ~root`/.config/guix/current" ; \
  468. source $GUIX_PROFILE/etc/profile
  469. @end example
  470. @item
  471. Erzeugen Sie Nutzergruppe und Nutzerkonten für die Erstellungs-Benutzer wie
  472. folgt (@pxref{Einrichten der Erstellungsumgebung}).
  473. @item
  474. Führen Sie den Daemon aus, und lassen Sie ihn automatisch bei jedem
  475. Hochfahren starten.
  476. Wenn Ihre Wirts-Distribution systemd als »init«-System verwendet, können Sie
  477. das mit folgenden Befehlen veranlassen:
  478. @c Versions of systemd that supported symlinked service files are not
  479. @c yet widely deployed, so we should suggest that users copy the service
  480. @c files into place.
  481. @c
  482. @c See this thread for more information:
  483. @c http://lists.gnu.org/archive/html/guix-devel/2017-01/msg01199.html
  484. @example
  485. # cp ~root/.config/guix/current/lib/systemd/system/guix-daemon.service \
  486. /etc/systemd/system/
  487. # systemctl start guix-daemon && systemctl enable guix-daemon
  488. @end example
  489. Wenn Ihre Wirts-Distribution als »init«-System Upstart verwendet:
  490. @example
  491. # initctl reload-configuration
  492. # cp ~root/.config/guix/current/lib/upstart/system/guix-daemon.conf \
  493. /etc/init/
  494. # start guix-daemon
  495. @end example
  496. Andernfalls können Sie den Daemon immer noch manuell starten, mit:
  497. @example
  498. # ~root/.config/guix/current/bin/guix-daemon \
  499. --build-users-group=guixbuild
  500. @end example
  501. @item
  502. Stellen Sie den @command{guix}-Befehl auch anderen Nutzern Ihrer Maschine
  503. zur Verfügung, zum Beispiel so:
  504. @example
  505. # mkdir -p /usr/local/bin
  506. # cd /usr/local/bin
  507. # ln -s /var/guix/profiles/per-user/root/current-guix/bin/guix
  508. @end example
  509. Es ist auch eine gute Idee, die Info-Version dieses Handbuchs ebenso
  510. verfügbar zu machen:
  511. @example
  512. # mkdir -p /usr/local/share/info
  513. # cd /usr/local/share/info
  514. # for i in /var/guix/profiles/per-user/root/current-guix/share/info/* ;
  515. do ln -s $i ; done
  516. @end example
  517. Auf diese Art wird, unter der Annahme, dass bei Ihnen
  518. @file{/usr/local/share/info} im Suchpfad eingetragen ist, das Ausführen von
  519. @command{info guix} dieses Handbuch öffnen (@pxref{Other Info Directories,,,
  520. texinfo, GNU Texinfo} hat weitere Details, wie Sie den Info-Suchpfad ändern
  521. können).
  522. @item
  523. @cindex Substitute, deren Autorisierung
  524. Um Substitute von @code{hydra.gnu.org} oder einem Spiegelserver davon zu
  525. benutzen (@pxref{Substitute}), müssen sie erst autorisiert werden:
  526. @example
  527. # guix archive --authorize < \
  528. ~root/.config/guix/current/share/guix/hydra.gnu.org.pub
  529. @end example
  530. @item
  531. Alle Nutzer müssen womöglich ein paar zusätzliche Schritte ausführen, damit
  532. ihre Guix-Umgebung genutzt werden kann, siehe @pxref{Anwendungen einrichten}.
  533. @end enumerate
  534. Voilà, die Installation ist fertig!
  535. Sie können nachprüfen, dass Guix funktioniert, indem Sie ein Beispielpaket
  536. in das root-Profil installieren:
  537. @example
  538. # guix package -i hello
  539. @end example
  540. The @code{guix} package must remain available in @code{root}'s profile, or
  541. it would become subject to garbage collection---in which case you would find
  542. yourself badly handicapped by the lack of the @command{guix} command. In
  543. other words, do not remove @code{guix} by running @code{guix package -r
  544. guix}.
  545. Der Tarball zur Installation aus einer Binärdatei kann einfach durch
  546. Ausführung des folgenden Befehls im Guix-Quellbaum (re-)produziert und
  547. verifiziert werden:
  548. @example
  549. make guix-binary.@var{system}.tar.xz
  550. @end example
  551. @noindent
  552. ...@: which, in turn, runs:
  553. @example
  554. guix pack -s @var{system} --localstatedir \
  555. --profile-name=current-guix guix
  556. @end example
  557. Siehe @xref{Aufruf von guix pack} für weitere Informationen zu diesem
  558. praktischen Werkzeug.
  559. @node Voraussetzungen
  560. @section Voraussetzungen
  561. Dieser Abschnitt listet Voraussetzungen auf, um Guix aus seinem Quellcode zu
  562. erstellen. Der Erstellungsprozess für Guix ist derselbe wie für andere
  563. GNU-Software und wird hier nicht beschrieben. Bitte lesen Sie die Dateien
  564. @file{README} und @file{INSTALL} im Guix-Quellbaum, um weitere Details zu
  565. erfahren.
  566. GNU Guix hat folgende Pakete als Abhängigkeiten:
  567. @itemize
  568. @item @url{http://gnu.org/software/guile/, GNU Guile}, Version 2.0.13 oder
  569. neuer, einschließlich 2.2.x,
  570. @item @url{https://notabug.org/cwebber/guile-gcrypt, Guile-Gcrypt}, version
  571. 0.1.0 or later;
  572. @item
  573. @uref{http://gnutls.org/, GnuTLS}, im Speziellen dessen Bindungen für Guile
  574. (@pxref{Guile Preparations, how to install the GnuTLS bindings for Guile,,
  575. gnutls-guile, GnuTLS-Guile}),
  576. @item
  577. @uref{https://notabug.org/guile-sqlite3/guile-sqlite3, Guile-SQLite3},
  578. version 0.1.0 or later;
  579. @item
  580. @c FIXME: Specify a version number once a release has been made.
  581. @uref{https://gitlab.com/guile-git/guile-git, Guile-Git}, vom August 2017
  582. oder neuer,
  583. @item @url{http://zlib.net, zlib},
  584. @item @url{http://www.gnu.org/software/make/, GNU Make}.
  585. @end itemize
  586. Folgende Abhängigkeiten sind optional:
  587. @itemize
  588. @item
  589. Wenn Sie @url{http://savannah.nongnu.org/projects/guile-json/, Guile-JSON}
  590. installieren, können Sie den Befehl @command{guix import pypi} benutzen
  591. (@pxref{Aufruf von guix import}). Das spielt hauptsächlich für Entwickler und
  592. nicht für Gelegenheitsnutzer eine Rolle.
  593. @item
  594. @c Note: We need at least 0.10.2 for 'channel-send-eof'.
  595. Unterstützung für das Auslagern von Erstellungen (@pxref{Auslagern des Daemons einrichten}) und @command{guix copy} (@pxref{Aufruf von guix copy}) hängt von
  596. @uref{https://github.com/artyom-poptsov/guile-ssh, Guile-SSH}, Version
  597. 0.10.2 oder neuer, ab.
  598. @item
  599. Wenn @url{http://www.bzip.org, libbz2} verfügbar ist, kann
  600. @command{guix-daemon} damit Erstellungsprotokolle komprimieren.
  601. @end itemize
  602. Sofern nicht @code{--disable-daemon} beim Aufruf von @command{configure}
  603. übergeben wurde, benötigen Sie auch folgende Pakete:
  604. @itemize
  605. @item @url{http://gnupg.org/, GNU libgcrypt},
  606. @item @url{http://sqlite.org, SQLite 3},
  607. @item @url{http://gcc.gnu.org, GCC's g++} mit Unterstützung für den
  608. C++11-Standard.
  609. @end itemize
  610. @cindex Zustandsverzeichnis
  611. Sollten Sie Guix auf einem System konfigurieren, auf dem Guix bereits
  612. installiert ist, dann stellen Sie sicher, dasselbe Zustandsverzeichnis wie
  613. für die bestehende Installation zu verwenden. Benutzen Sie dazu die
  614. Befehlszeilenoption @code{--localstatedir} des @command{configure}-Skripts
  615. (@pxref{Directory Variables, @code{localstatedir},, standards, GNU Coding
  616. Standards}). Das @command{configure}-Skript schützt vor ungewollter
  617. Fehlkonfiguration der @var{localstatedir}, damit sie nicht versehentlich
  618. Ihren Store verfälschen (@pxref{Der Store}).
  619. @cindex Nix, Kompatibilität
  620. Wenn eine funktionierende Installation of @url{http://nixos.org/nix/, the
  621. Nix package manager} verfügbar ist, können Sie Guix stattdessen mit
  622. @code{--disable-daemon} konfigurieren. In diesem Fall ersetzt Nix die drei
  623. oben genannten Abhängigkeiten.
  624. Guix ist mit Nix kompatibel, daher ist es möglich, denselben Store für beide
  625. zu verwenden. Dazu müssen Sie an @command{configure} nicht nur denselben
  626. Wert für @code{--with-store-dir} übergeben, sondern auch denselben Wert für
  627. @code{--localstatedir}. Letzterer ist deswegen essenziell, weil er unter
  628. Anderem angibt, wo die Datenbank liegt, in der sich die Metainformationen
  629. über den Store befinden. Für Nix sind die Werte standardmäßig
  630. @code{--with-store-dir=/nix/store} und
  631. @code{--localstatedir=/nix/var}. Beachten Sie, dass @code{--disable-daemon}
  632. nicht erforderlich ist, wenn Sie die Absicht haben, den Store mit Nix zu
  633. teilen.
  634. @node Die Testsuite laufen lassen
  635. @section Die Testsuite laufen lassen
  636. @cindex Testkatalog
  637. Nachdem @command{configure} und @code{make} erfolgreich durchgelaufen sind,
  638. ist es ratsam, den Testkatalog auszuführen. Er kann dabei helfen, Probleme
  639. mit der Einrichtung oder Systemumgebung zu finden, oder auch Probleme in
  640. Guix selbst — und Testfehler zu melden ist eine wirklich gute Art und Weise,
  641. bei der Verbesserung von Guix mitzuhelfen. Um den Testkatalog auszuführen,
  642. geben Sie Folgendes ein:
  643. @example
  644. make check
  645. @end example
  646. Testfälle können parallel ausgeführt werden. Sie können die
  647. Befehlszeiltenoption @code{-j} von GNU@tie{}make benutzen, damit es
  648. schneller geht. Der erste Durchlauf kann auf neuen Maschinen ein paar
  649. Minuten dauern, nachfolgende Ausführungen werden schneller sein, weil der
  650. für die Tests erstellte Store schon einige Dinge zwischengespeichert haben
  651. wird.
  652. Es ist auch möglich, eine Teilmenge der Tests laufen zu lassen, indem Sie
  653. die @code{TESTS}-Variable des Makefiles ähnlich wie in diesem Beispiel
  654. definieren:
  655. @example
  656. make check TESTS="tests/store.scm tests/cpio.scm"
  657. @end example
  658. Standardmäßig werden Testergebnisse pro Datei angezeigt. Um die Details
  659. jedes einzelnen Testfalls zu sehen, können Sie wie in diesem Beispiel die
  660. @code{SCM_LOG_DRIVER_FLAGS}-Variable des Makefiles definieren:
  661. @example
  662. make check TESTS="tests/base64.scm" SCM_LOG_DRIVER_FLAGS="--brief=no"
  663. @end example
  664. Kommt es zum Fehlschlag, senden Sie bitte eine E-Mail an
  665. @email{bug-guix@@gnu.org} und fügen Sie die Datei @file{test-suite.log} als
  666. Anhang bei. Bitte geben Sie dabei in Ihrer Nachricht die benutzte Version
  667. von Guix an sowie die Versionsnummern der Abhängigkeiten
  668. (@pxref{Voraussetzungen}).
  669. Guix wird auch mit einem Testkatalog für das ganze System ausgeliefert, der
  670. vollständige Instanzen des GuixSD-Betriebssystems testet. Er kann nur auf
  671. Systemen benutzt werden, auf denen Guix bereits installiert ist, mit
  672. folgendem Befehl:
  673. @example
  674. make check-system
  675. @end example
  676. @noindent
  677. Oder, auch hier, indem Sie @code{TESTS} definieren, um eine Teilmenge der
  678. auszuführenden Tests anzugeben:
  679. @example
  680. make check-system TESTS="basic mcron"
  681. @end example
  682. Diese Systemtests sind in den @code{(gnu tests @dots{})}-Modulen
  683. definiert. Sie funktionieren, indem Sie das getestete Betriebssystem mitsamt
  684. schlichter Instrumentierung in einer virtuellen Maschine (VM) ausführen. Die
  685. Tests können aufwendige Berechnungen durchführen oder sie günstig umgehen,
  686. je nachdem, ob für ihre Abhängigkeiten Substitute zur Verfügung stehen
  687. (@pxref{Substitute}). Manche von ihnen nehmen viel Speicherplatz in
  688. Anspruch, um die VM-Abbilder zu speichern.
  689. Auch hier gilt: Falls Testfehler auftreten, senden Sie bitte alle Details an
  690. @email{bug-guix@@gnu.org}.
  691. @node Den Daemon einrichten
  692. @section Den Daemon einrichten
  693. @cindex Daemon
  694. Operationen wie das Erstellen eines Pakets oder Laufenlassen des
  695. Müllsammlers werden alle durch einen spezialisierten Prozess durchgeführt,
  696. den @dfn{Erstellungs-Daemon}, im Auftrag seiner Kunden (den Clients). Nur
  697. der Daemon darf auf den Store und seine zugehörige Datenbank
  698. zugreifen. Daher wird jede den Store verändernde Operation durch den Daemon
  699. durchgeführt. Zum Beispiel kommunizieren Befehlszeilenwerkzeuge wie
  700. @command{guix package} und @command{guix build} mit dem Daemon (mittels
  701. entfernter Prozeduraufrufe), um ihm Anweisungen zu geben, was er tun soll.
  702. Folgende Abschnitte beschreiben, wie Sie die Umgebung des
  703. Erstellungs-Daemons ausstatten sollten. Siehe auch @ref{Substitute} für
  704. Informationen darüber, wie Sie es dem Daemon ermöglichen, vorerstellte
  705. Binärdateien herunterzuladen.
  706. @menu
  707. * Einrichten der Erstellungsumgebung:: Die isolierte Umgebung zum Erstellen
  708. vorbereiten.
  709. * Auslagern des Daemons einrichten:: Erstellungen auf entfernte Maschinen
  710. auslagern.
  711. * SELinux-Unterstützung:: Wie man eine SELinux-Richtlinie für den Daemon
  712. einrichtet.
  713. @end menu
  714. @node Einrichten der Erstellungsumgebung
  715. @subsection Einrichten der Erstellungsumgebung
  716. @cindex Erstellungsumgebung
  717. In einem normalen Mehrbenutzersystem werden Guix und sein Daemon — das
  718. Programm @command{guix-daemon} — vom Systemadministrator installiert;
  719. @file{/gnu/store} gehört @code{root} und @command{guix-daemon} läuft als
  720. @code{root}. Nicht mit erweiterten Rechten ausgestattete Nutzer können
  721. Guix-Werkzeuge benutzen, um Pakete zu erstellen oder anderweitig auf den
  722. Store zuzugreifen, und der Daemon wird dies für sie erledigen und dabei
  723. sicherstellen, dass der Store in einem konsistenten Zustand verbleibt und
  724. sich die Nutzer erstellte Pakete teilen.
  725. @cindex Erstellungsbenutzer
  726. Wenn @command{guix-daemon} als Administratornutzer @code{root} läuft, wollen
  727. Sie aber vielleicht dennoch nicht, dass Paketerstellungsprozesse auch als
  728. @code{root} ablaufen, aus offensichtlichen Sicherheitsgründen. Um dies zu
  729. vermeiden, sollte ein besonderer Pool aus @dfn{Erstellungsbenutzern}
  730. geschaffen werden, damit vom Daemon gestartete Erstellungsprozesse ihn
  731. benutzen. Diese Erstellungsbenutzer müssen weder eine Shell noch einen
  732. Persönlichen Ordner zugewiesen bekommen, sie werden lediglich benutzt, wenn
  733. der Daemon @code{root}-Rechte in Erstellungsprozessen ablegt. Mehrere solche
  734. Benutzer zu haben, ermöglicht es dem Daemon, verschiedene
  735. Erstellungsprozessen unter verschiedenen Benutzeridentifikatoren (UIDs) zu
  736. starten, was garantiert, dass sie einander nicht stören — eine essenzielle
  737. Funktionalität, da Erstellungen als reine Funktionen angesehen werden
  738. (@pxref{Einführung}).
  739. Auf einem GNU/Linux-System kann ein Pool von Erstellungsbenutzern wie folgt
  740. erzeugt werden (mit Bash-Syntax und den Befehlen von @code{shadow}):
  741. @c See http://lists.gnu.org/archive/html/bug-guix/2013-01/msg00239.html
  742. @c for why `-G' is needed.
  743. @example
  744. # groupadd --system guixbuild
  745. # for i in `seq -w 1 10`;
  746. do
  747. useradd -g guixbuild -G guixbuild \
  748. -d /var/empty -s `which nologin` \
  749. -c "Guix-Erstellungsbenutzer $i" --system \
  750. guixbuilder$i;
  751. done
  752. @end example
  753. @noindent
  754. Die Anzahl der Erstellungsbenutzer entscheidet, wieviele Erstellungsaufträge
  755. parallel ausgeführt werden können, wie es mit der Befehlszeilenoption
  756. @option{--max-jobs} vorgegeben werden kann (@pxref{Aufruf des guix-daemon,
  757. @option{--max-jobs}}). Um @command{guix system vm} und ähnliche Befehle
  758. nutzen zu können, müssen Sie die Erstellungsbenutzer unter Umständen zur
  759. @code{kvm}-Benutzergruppe hinzufügen, damit sie Zugriff auf @file{/dev/kvm}
  760. haben, mit @code{-G guixbuild,kvm} statt @code{-G guixbuild}
  761. (@pxref{Aufruf von guix system}).
  762. Das Programm @code{guix-daemon} kann mit dem folgenden Befehl als
  763. @code{root} gestartet werden@footnote{Wenn Ihre Maschine systemd als
  764. »init«-System verwendet, genügt es, die Datei
  765. @file{@var{prefix}/lib/systemd/system/guix-daemon.service} in
  766. @file{/etc/systemd/system} zu platzieren, damit @command{guix-daemon}
  767. automatisch gestartet wird. Ebenso können Sie, wenn Ihre Maschine Upstart
  768. als »init«-System benutzt, die Datei
  769. @file{@var{prefix}/lib/upstart/system/guix-daemon.conf} in @file{/etc/init}
  770. platzieren.}:
  771. @example
  772. # guix-daemon --build-users-group=guixbuild
  773. @end example
  774. @cindex chroot
  775. @noindent
  776. Auf diese Weise startet der Daemon Erstellungsprozesse in einem chroot als
  777. einer der @code{guixbuilder}-Benutzer. Auf GNU/Linux enthält die
  778. chroot-Umgebung standardmäßig nichts außer:
  779. @c Keep this list in sync with libstore/build.cc! -----------------------
  780. @itemize
  781. @item
  782. einem minimalen @code{/dev}-Verzeichnis, was größtenteils vom @code{/dev}
  783. des Wirtssystems unabhängig erstellt wurde@footnote{»Größtenteils«, denn
  784. obwohl die Menge an Dateien, die im @code{/dev} des chroots vorkommen, fest
  785. ist, können die meisten dieser Dateien nur dann erstellt werden, wenn das
  786. Wirtssystem sie auch hat.},
  787. @item
  788. dem @code{/proc}-Verzeichnis, es zeigt nur die Prozesse des Containers, weil
  789. ein separater Namensraum für Prozess-IDs (PIDs) benutzt wird,
  790. @item
  791. @file{/etc/passwd} mit einem Eintrag für den aktuellen Benutzer und einem
  792. Eintrag für den Benutzer @file{nobody},
  793. @item
  794. @file{/etc/group} mit einem Eintrag für die Gruppe des Benutzers,
  795. @item
  796. @file{/etc/hosts} mit einem Eintrag, der @code{localhost} auf
  797. @code{127.0.0.1} abbildet,
  798. @item
  799. einem @file{/tmp}-Verzeichnis mit Schreibrechten.
  800. @end itemize
  801. Sie können beeinflussen, in welchem Verzeichnis der Daemon Erstellungsbäume
  802. unterbringt, indem sie den Wert der Umgebungsvariablen @code{TMPDIR}
  803. ändern. Allerdings heißt innerhalb des chroots der Erstellungsbaum immer
  804. @file{/tmp/guix-build-@var{name}.drv-0}, wobei @var{name} der Ableitungsname
  805. ist — z.B. @code{coreutils-8.24}. Dadurch hat der Wert von @code{TMPDIR}
  806. keinen Einfluss auf die Erstellungsumgebung, wodurch Unterschiede vermieden
  807. werden, falls Erstellungsprozesse den Namen ihres Erstellungsbaumes
  808. einfangen.
  809. @vindex http_proxy
  810. Der Daemon befolgt außerdem den Wert der Umgebungsvariablen
  811. @code{http_proxy} für von ihm durchgeführte HTTP-Downloads, sei es für
  812. Ableitungen mit fester Ausgabe (@pxref{Ableitungen}) oder für Substitute
  813. (@pxref{Substitute}).
  814. Wenn Sie Guix als ein Benutzer ohne erweiterte Rechte installieren, ist es
  815. dennoch möglich, @command{guix-daemon} auszuführen, sofern Sie
  816. @code{--disable-chroot} übergeben. Allerdings können Erstellungsprozesse
  817. dann nicht voneinander und vom Rest des Systems isoliert werden. Daher
  818. können sich Erstellungsprozesse gegenseitig stören und auf Programme,
  819. Bibliotheken und andere Dateien zugreifen, die dem restlichen System zur
  820. Verfügung stehen — was es deutlich schwerer macht, sie als @emph{reine}
  821. Funktionen aufzufassen.
  822. @node Auslagern des Daemons einrichten
  823. @subsection Nutzung der Auslagerungsfunktionalität
  824. @cindex auslagern
  825. @cindex Build-Hook
  826. Wenn erwünscht kann der Erstellungs-Daemon Ableitungserstellungen
  827. @dfn{auslagern} auf andere Maschinen, auf denen Guix läuft, mit Hilfe des
  828. @code{offload}-»@dfn{Build-Hooks}«@footnote{Diese Funktionalität ist nur
  829. verfügbar, wenn @uref{https://github.com/artyom-poptsov/guile-ssh,
  830. Guile-SSH} vorhanden ist.}. Wenn diese Funktionalität aktiviert ist, wird
  831. eine nutzerspezifizierte Liste von Erstellungsmaschinen aus
  832. @file{/etc/guix/machines.scm} gelesen. Wann immer eine Erstellung angefragt
  833. wird, zum Beispiel durch @code{guix build}, versucht der Daemon, sie an eine
  834. der Erstellungsmaschinen auszulagern, die die Einschränkungen der Ableitung
  835. erfüllen, insbesondere ihren Systemtyp — z.B. @file{x86_64-linux}. Fehlende
  836. Voraussetzungen für die Erstellung werden über SSH auf die Zielmaschine
  837. kopiert, welche dann mit der Erstellung weitermacht. Hat sie Erfolg damit,
  838. so werden die Ausgabe oder Ausgaben der Erstellung zurück auf die
  839. ursprüngliche Maschine kopiert.
  840. Die Datei @file{/etc/guix/machines.scm} sieht normalerweise so aus:
  841. @example
  842. (list (build-machine
  843. (name "eightysix.example.org")
  844. (system "x86_64-linux")
  845. (host-key "ssh-ed25519 AAAAC3Nza@dots{}")
  846. (user "bob")
  847. (speed 2.)) ;unglaublich schnell!
  848. (build-machine
  849. (name "meeps.example.org")
  850. (system "mips64el-linux")
  851. (host-key "ssh-rsa AAAAB3Nza@dots{}")
  852. (user "alice")
  853. (private-key
  854. (string-append (getenv "HOME")
  855. "/.ssh/identität-für-guix"))))
  856. @end example
  857. @noindent
  858. Im obigen Beispiel geben wir eine Liste mit zwei Erstellungsmaschinen vor,
  859. eine für die @code{x86_64}-Architektur und eine für die
  860. @code{mips64el}-Architektur.
  861. Tatsächlich ist diese Datei — wenig überraschend! — eine Scheme-Datei, die
  862. ausgewertet wird, wenn der @code{offload}-Hook gestartet wird. Der Wert, den
  863. sie zurückliefert, muss eine Liste von @code{build-machine}-Objekten
  864. sein. Obwohl dieses Beispiel eine feste Liste von Erstellungsmaschinen
  865. zeigt, könnte man auch auf die Idee kommen, etwa mit DNS-SD eine Liste
  866. möglicher im lokalen Netzwerk entdeckter Erstellungsmaschinen zu liefern
  867. (@pxref{Einführung, Guile-Avahi,, guile-avahi, Using Avahi in Guile Scheme
  868. Programs}). Der Datentyp @code{build-machine} wird im Folgenden weiter
  869. ausgeführt.
  870. @deftp {Datentyp} build-machine
  871. Dieser Datentyp repräsentiert Erstellungsmaschinen, an die der Daemon
  872. Erstellungen auslagern darf. Die wichtigen Felder sind:
  873. @table @code
  874. @item name
  875. Der Hostname der entfernten Maschine.
  876. @item system
  877. Der Systemtyp der entfernten Maschine — z.B. @code{"x86_64-linux"}.
  878. @item user
  879. Das Benutzerkonto, mit dem eine Verbindung zur entfernten Maschine über SSH
  880. aufgebaut werden soll. Beachten Sie, dass das SSH-Schlüsselpaar @emph{nicht}
  881. durch eine Passphrase geschützt sein darf, damit nicht-interaktive
  882. Anmeldungen möglich sind.
  883. @item host-key
  884. Dies muss der @dfn{öffentliche SSH-Host-Schlüssel} der Maschine im
  885. OpenSSH-Format sein. Er wird benutzt, um die Identität der Maschine zu
  886. prüfen, wenn wir uns mit ihr verbinden. Er ist eine lange Zeichenkette, die
  887. ungefähr so aussieht:
  888. @example
  889. ssh-ed25519 AAAAC3NzaC@dots{}mde+UhL hint@@example.org
  890. @end example
  891. Wenn auf der Maschine der OpenSSH-Daemon, @command{sshd}, läuft, ist der
  892. Host-Schlüssel in einer Datei wie @file{/etc/ssh/ssh_host_ed25519_key.pub}
  893. zu finden.
  894. Wenn auf der Maschine der SSH-Daemon von GNU@tie{}lsh, nämlich
  895. @command{lshd}, läuft, befindet sich der Host-Schlüssel in
  896. @file{/etc/lsh/host-key.pub} oder einer ähnlichen Datei. Er kann ins
  897. OpenSSH-Format umgewandelt werden durch @command{lsh-export-key}
  898. (@pxref{Converting keys,,, lsh, LSH Manual}):
  899. @example
  900. $ lsh-export-key --openssh < /etc/lsh/host-key.pub
  901. ssh-rsa AAAAB3NzaC1yc2EAAAAEOp8FoQAAAQEAs1eB46LV@dots{}
  902. @end example
  903. @end table
  904. Eine Reihe optionaler Felder kann festgelegt werden:
  905. @table @asis
  906. @item @code{port} (Vorgabe: @code{22})
  907. Portnummer des SSH-Servers auf der Maschine.
  908. @item @code{private-key} (Vorgabe: @file{~root/.ssh/id_rsa})
  909. The SSH private key file to use when connecting to the machine, in OpenSSH
  910. format. This key must not be protected with a passphrase.
  911. Beachten Sie, dass als Vorgabewert der private Schlüssel @emph{des
  912. root-Benutzers} genommen wird. Vergewissern Sie sich, dass er existiert,
  913. wenn Sie die Standardeinstellung verwenden.
  914. @item @code{compression} (Vorgabe: @code{"zlib@@openssh.com,zlib"})
  915. @itemx @code{compression-level} (Vorgabe: @code{3})
  916. Die Kompressionsmethoden auf SSH-Ebene und das angefragte
  917. Kompressionsniveau.
  918. Beachten Sie, dass Auslagerungen SSH-Kompression benötigen, um beim
  919. Übertragen von Dateien an Erstellungsmaschinen und zurück weniger Bandbreite
  920. zu benutzen.
  921. @item @code{daemon-socket} (Vorgabe: @code{"/var/guix/daemon-socket/socket"})
  922. Dateiname des Unix-Sockets, auf dem @command{guix-daemon} auf der Maschine
  923. lauscht.
  924. @item @code{parallel-builds} (Vorgabe: @code{1})
  925. Die Anzahl der Erstellungen, die auf der Maschine parallel ausgeführt werden
  926. können.
  927. @item @code{speed} (Vorgabe: @code{1.0})
  928. Ein »relativer Geschwindigkeitsfaktor«. Der Auslagerungsplaner gibt
  929. tendenziell Maschinen mit höherem Geschwindigkeitsfaktor den Vorrang.
  930. @item @code{features} (Vorgabe: @code{'()})
  931. Eine Liste von Zeichenketten, die besondere von der Maschine unterstützte
  932. Funktionalitäten bezeichnen. Ein Beispiel ist @code{"kvm"} für Maschinen,
  933. die über die KVM-Linux-Module zusammen mit entsprechender
  934. Hardware-Unterstützung verfügen. Ableitungen können Funktionalitäten dem
  935. Namen nach anfragen und werden dann auf passenden Erstellungsmaschinen
  936. eingeplant.
  937. @end table
  938. @end deftp
  939. Der Befehl @code{guile} muss sich im Suchpfad der Erstellungsmaschinen
  940. befinden. Zusätzlich müssen die Guix-Module im @code{$GUILE_LOAD_PATH} auf
  941. den Erstellungsmaschinen zu finden sein — um dies nachzuprüfen, können Sie
  942. Folgendes ausführen:
  943. @example
  944. ssh build-machine guile -c "'(use-modules (guix config))'"
  945. @end example
  946. Es gibt noch eine weitere Sache zu tun, sobald @file{machines.scm}
  947. eingerichtet ist. Wie zuvor erklärt, werden beim Auslagern Dateien zwischen
  948. den Stores der Maschinen hin- und hergeschickt. Damit das funktioniert,
  949. müssen Sie als Erstes ein Schlüsselpaar auf jeder Maschine erzeugen, damit
  950. der Daemon signierte Archive mit den Dateien aus dem Store versenden kann
  951. (@pxref{Aufruf von guix archive}):
  952. @example
  953. # guix archive --generate-key
  954. @end example
  955. @noindent
  956. Jede Erstellungsmaschine muss den Schlüssel der Hauptmaschine autorisieren,
  957. damit diese Store-Objekte von der Hauptmaschine empfangen kann:
  958. @example
  959. # guix archive --authorize < öffentlicher-schlüssel-hauptmaschine.txt
  960. @end example
  961. @noindent
  962. Andersherum muss auch die Hauptmaschine den jeweiligen Schlüssel jeder
  963. Erstellungsmaschine autorisieren.
  964. Der ganze Umstand mit den Schlüsseln soll ausdrücken, dass sich Haupt- und
  965. Erstellungsmaschinen paarweise gegenseitig vertrauen. Konkret kann der
  966. Erstellungs-Daemon auf der Hauptmaschine die Echtheit von den
  967. Erstellungsmaschinen empfangener Dateien gewährleisten (und umgekehrt), und
  968. auch dass sie nicht sabotiert wurden und mit einem autorisierten Schlüssel
  969. signiert wurden.
  970. @cindex Auslagerung testen
  971. Um zu testen, ob Ihr System funktioniert, führen Sie diesen Befehl auf der
  972. Hauptmaschine aus:
  973. @example
  974. # guix offload test
  975. @end example
  976. Dadurch wird versucht, zu jeder Erstellungsmaschine eine Verbindung
  977. herzustellen, die in @file{/etc/guix/machines.scm} angegeben wurde,
  978. sichergestellt, dass auf jeder Guile und die Guix-Module nutzbar sind, und
  979. jeweils versucht, etwas auf die Erstellungsmaschine zu exportieren und von
  980. dort zu imporieren. Dabei auftretende Fehler werden gemeldet.
  981. Wenn Sie stattdessen eine andere Maschinendatei verwenden möchten, geben Sie
  982. diese einfach auf der Befehlszeile an:
  983. @example
  984. # guix offload test maschinen-qualif.scm
  985. @end example
  986. Letztendlich können Sie hiermit nur die Teilmenge der Maschinen testen,
  987. deren Name zu einem regulären Ausdruck passt:
  988. @example
  989. # guix offload test maschinen.scm '\.gnu\.org$'
  990. @end example
  991. @cindex Auslagerungs-Lagebericht
  992. Um die momentane Auslastung aller Erstellungs-Hosts anzuzeigen, führen Sie
  993. diesen Befehl auf dem Hauptknoten aus:
  994. @example
  995. # guix offload status
  996. @end example
  997. @node SELinux-Unterstützung
  998. @subsection SELinux-Unterstützung
  999. @cindex SELinux, Policy für den Daemon
  1000. @cindex Mandatory Access Control, SELinux
  1001. @cindex Sicherheit, des guix-daemon
  1002. Guix enthält eine SELinux-Richtliniendatei (»Policy«) unter
  1003. @file{etc/guix-daemon.cil}, die auf einem System installiert werden
  1004. kann, auf dem SELinux aktiviert ist, damit Guix-Dateien gekennzeichnet
  1005. sind, und um das erwartete Verhalten des Daemons anzugeben. Da GuixSD
  1006. keine Grundrichtlinie (»Base Policy«) für SELinux bietet, kann diese
  1007. Richtlinie für den Daemon auf GuixSD nicht benutzt werden.
  1008. @subsubsection Installieren der SELinux-Policy
  1009. @cindex SELinux, Policy installieren
  1010. Um die Richtlinie (Policy) zu installieren, führen Sie folgenden Befehl mit
  1011. Administratorrechten aus:
  1012. @example
  1013. semodule -i etc/guix-daemon.cil
  1014. @end example
  1015. Kennzeichnen Sie dann das Dateisystem neu mit @code{restorecon} oder einem
  1016. anderen, von Ihrem System angebotenen Mechanismus.
  1017. Sobald die Richtlinie installiert ist, das Dateisystem neu gekennzeichnet
  1018. wurde und der Daemon neugestartet wurde, sollte er im Kontext
  1019. @code{guix_daemon_t} laufen. Sie können dies mit dem folgenden Befehl
  1020. nachprüfen:
  1021. @example
  1022. ps -Zax | grep guix-daemon
  1023. @end example
  1024. Beobachten Sie die Protokolldateien von SELinux, wenn Sie einen Befehl wie
  1025. @code{guix build hello} ausführen, um sich zu überzeugen, dass SELinux alle
  1026. notwendigen Operationen gestattet.
  1027. @subsubsection Einschränkungen
  1028. @cindex SELinux, Einschränkungen
  1029. Diese Richtlinie ist nicht perfekt. Im Folgenden finden Sie eine Liste von
  1030. Einschränkungen oder merkwürdigen Verhaltensweisen, die bedacht werden
  1031. sollten, wenn man die mitgelieferte SELinux-Richtlinie für den Guix-Daemon
  1032. einspielt.
  1033. @enumerate
  1034. @item
  1035. @code{guix_daemon_socket_t} wird nicht wirklich benutzt. Keine der
  1036. Socket-Operationen benutzt Kontexte, die irgendetwas mit
  1037. @code{guix_daemon_socket_t} zu tun haben. Es schadet nicht, diese ungenutzte
  1038. Kennzeichnung zu haben, aber es wäre besser, für die Kennzeichnung auch
  1039. Socket-Regeln festzulegen.
  1040. @item
  1041. @code{guix gc} kann nicht auf beliebige Verknüpfungen zu Profilen
  1042. zugreifen. Die Kennzeichnung des Ziels einer symbolischen Verknüpfung ist
  1043. notwendigerweise unabhängig von der Dateikennzeichnung der
  1044. Verknüpfung. Obwohl alle Profile unter $localstatedir gekennzeichnet sind,
  1045. erben die Verknüpfungen auf diese Profile die Kennzeichnung desjenigen
  1046. Verzeichnisses, in dem sie sich befinden. Für Verknüpfungen im Persönlichen
  1047. Ordner des Benutzers ist das @code{user_home_t}, aber Verknüpfungen aus dem
  1048. Persönlichen Ordner des Administratornutzers, oder @file{/tmp}, oder das
  1049. Arbeitsverzeichnis des HTTP-Servers, etc., funktioniert das
  1050. nicht. @code{guix gc} würde es nicht gestattet, diese Verknüpfungen
  1051. auszulesen oder zu verfolgen.
  1052. @item
  1053. Die vom Daemon gebotene Funktionalität, auf TCP-Verbindungen zu lauschen,
  1054. könnte nicht mehr funktionieren. Dies könnte zusätzliche Regeln brauchen,
  1055. weil SELinux Netzwerk-Sockets anders behandelt als Dateien.
  1056. @item
  1057. Derzeit wird allen Dateien mit einem Namen, der zum regulären Ausdruck
  1058. @code{/gnu/store/.+-(guix-.+|profile)/bin/guix-daemon} passt, die
  1059. Kennzeichnung @code{guix_daemon_exec_t} zugewiesen, wodurch @emph{jede
  1060. beliebige} Datei mit diesem Namen in irgendeinem Profil gestattet wäre, in
  1061. der Domäne @code{guix_daemon_t} ausgeführt zu werden. Das ist nicht
  1062. ideal. Ein Angreifer könnte ein Paket erstellen, dass solch eine ausführbare
  1063. Datei enthält, und den Nutzer überzeugen, es zu installieren und
  1064. auszuführen. Dadurch käme es in die Domäne @code{guix_daemon_t}. Ab diesem
  1065. Punkt könnte SELinux nicht mehr verhindern, dass es auf Dateien zugreift,
  1066. auf die Prozesse in dieser Domäne zugreifen dürfen.
  1067. Wir könnten zum Zeitpunkt der Installation eine wesentlich restriktivere
  1068. Richtlinie generieren, für die nur @emph{genau derselbe} Dateiname des
  1069. gerade installierten @code{guix-daemon}-Programms als
  1070. @code{guix_daemon_exec_t} gekennzeichnet würde, statt einen vieles
  1071. umfassenden regulären Ausdruck zu benutzen. Aber dann müsste der
  1072. Administratornutzer zum Zeitpunkt der Installation jedes Mal die Richtlinie
  1073. installieren oder aktualisieren müssen, sobald das Guix-Paket aktualisiert
  1074. wird, dass das tatsächlich in Benutzung befindliche
  1075. @code{guix-daemon}-Programm enthält.
  1076. @end enumerate
  1077. @node Aufruf des guix-daemon
  1078. @section Aufruf von @command{guix-daemon}
  1079. Das Programm @command{guix-daemon} implementiert alle Funktionalitäten, um
  1080. auf den Store zuzugreifen. Dazu gehört das Starten von Erstellungsprozessen,
  1081. das Ausführen des Müllsammlers, das Abfragen, ob ein Erstellungsergebnis
  1082. verfügbar ist, etc. Normalerweise wird er so als Administratornutzer
  1083. (@code{root}) gestartet:
  1084. @example
  1085. # guix-daemon --build-users-group=guixbuild
  1086. @end example
  1087. @noindent
  1088. Details, wie Sie ihn einrichten, finden Sie im Abschnitt @pxref{Den Daemon einrichten}.
  1089. @cindex chroot
  1090. @cindex Container, Erstellungsumgebung
  1091. @cindex Erstellungsumgebung
  1092. @cindex Reproduzierbare Erstellungen
  1093. Standardmäßig führt @command{guix-daemon} Erstellungsprozesse mit
  1094. unterschiedlichen UIDs aus, die aus der Erstellungsgruppe stammen, deren
  1095. Name mit @code{--build-users-group} übergeben wurde. Außerdem läuft jeder
  1096. Erstellungsprozess in einer chroot-Umgebung, die nur die Teilmenge des
  1097. Stores enthält, von der der Erstellungsprozess abhängt, entsprechend seiner
  1098. Ableitung (@pxref{Programmierschnittstelle, derivation}), und ein paar
  1099. bestimmte Systemverzeichnisse, darunter standardmäßig auch @file{/dev} und
  1100. @file{/dev/pts}. Zudem ist die Erstellungsumgebung auf GNU/Linux ein
  1101. @dfn{Container}: Nicht nur hat er seinen eigenen Dateisystembaum, er hat
  1102. auch einen separaten Namensraum zum Einhängen von Dateisystemen, seinen
  1103. eigenen Namensraum für PIDs, für Netzwerke, etc. Dies hilft dabei,
  1104. reproduzierbare Erstellungen zu garantieren (@pxref{Funktionalitäten}).
  1105. When the daemon performs a build on behalf of the user, it creates a build
  1106. directory under @file{/tmp} or under the directory specified by its
  1107. @code{TMPDIR} environment variable. This directory is shared with the
  1108. container for the duration of the build, though within the container, the
  1109. build tree is always called @file{/tmp/guix-build-@var{name}.drv-0}.
  1110. Nach Abschluss der Erstellung wird das Erstellungsverzeichnis automatisch
  1111. entfernt, außer wenn die Erstellung fehlgeschlagen ist und der Client
  1112. @option{--keep-failed} angegeben hat (@pxref{Aufruf von guix build,
  1113. @option{--keep-failed}}).
  1114. The daemon listens for connections and spawns one sub-process for each
  1115. session started by a client (one of the @command{guix} sub-commands.) The
  1116. @command{guix processes} command allows you to get an overview of the
  1117. activity on your system by viewing each of the active sessions and clients.
  1118. @xref{Invoking guix processes}, for more information.
  1119. Die folgenden Befehlszeilenoptionen werden unterstützt:
  1120. @table @code
  1121. @item --build-users-group=@var{Gruppe}
  1122. Verwende die Benutzerkonten aus der @var{Gruppe}, um Erstellungsprozesse
  1123. auszuführen (@pxref{Den Daemon einrichten, build users}).
  1124. @item --no-substitutes
  1125. @cindex Substitute
  1126. Benutze keine Substitute für Erstellungsergebnisse. Das heißt, dass alle
  1127. Objekte lokal erstellt werden müssen, und kein Herunterladen von vorab
  1128. erstellten Binärdateien erlaubt ist (@pxref{Substitute}).
  1129. Wenn der Daemon mit @code{--no-substitutes} ausgeführt wird, können Clients
  1130. trotzdem Substitute explizit aktivieren über den entfernten Prozeduraufruf
  1131. @code{set-build-options} (@pxref{Der Store}).
  1132. @item --substitute-urls=@var{URLs}
  1133. @anchor{daemon-substitute-urls}
  1134. Benutze @var{URLs} als standardmäßige, leerzeichengetrennte Liste der
  1135. Quell-URLs für Substitute. Wenn diese Befehlszeilenoption nicht angegeben
  1136. wird, wird @indicateurl{https://mirror.hydra.gnu.org https://hydra.gnu.org}
  1137. verwendet (@code{mirror.hydra.gnu.org} ist ein Spiegelserver für
  1138. @code{hydra.gnu.org}).
  1139. Das hat zur Folge, dass Substitute von den @var{URLs} heruntergeladen werden
  1140. können, solange sie mit einer Signatur versehen sind, der vertraut wird
  1141. (@pxref{Substitute}).
  1142. @cindex Build-Hook
  1143. @item --no-build-hook
  1144. Den »@dfn{Build-Hook}« nicht benutzen.
  1145. »Build-Hook« ist der Name eines Hilfsprogramms, das der Daemon starten kann
  1146. und an das er Erstellungsanfragen übermittelt. Durch diesen Mechanismus
  1147. können Erstellungen an andere Maschinen ausgelagert werden (@pxref{Auslagern des Daemons einrichten}).
  1148. @item --cache-failures
  1149. Fehler bei der Erstellung zwischenspeichern. Normalerweise werden nur
  1150. erfolgreiche Erstellungen gespeichert.
  1151. Wenn diese Befehlszeilenoption benutzt wird, kann @command{guix gc
  1152. --list-failures} benutzt werden, um die Menge an Store-Objekten abzufragen,
  1153. die als Fehlschläge markiert sind; @command{guix gc --clear-failures}
  1154. entfernt Store-Objekte aus der Menge zwischengespeicherter
  1155. Fehlschläge. @xref{Aufruf von guix gc}.
  1156. @item --cores=@var{n}
  1157. @itemx -c @var{n}
  1158. @var{n} CPU-Kerne zum Erstellen jeder Ableitung benutzen; @code{0} heißt, so
  1159. viele wie verfügbar sind.
  1160. Der Vorgabewert ist @code{0}, jeder Client kann jedoch eine abweichende
  1161. Anzahl vorgeben, zum Beispiel mit der Befehlszeilenoption @code{--cores} von
  1162. @command{guix build} (@pxref{Aufruf von guix build}).
  1163. Dadurch wird die Umgebungsvariable @code{NIX_BUILD_CORES} im
  1164. Erstellungsprozess definiert, welcher sie benutzen kann, um intern parallele
  1165. Ausführungen zuzulassen — zum Beispiel durch Nutzung von @code{make
  1166. -j$NIX_BUILD_CORES}.
  1167. @item --max-jobs=@var{n}
  1168. @itemx -M @var{n}
  1169. Höchstenss @var{n} Erstellungsaufträge parallel bearbeiten. Der Vorgabewert
  1170. liegt bei @code{1}. Wird er auf @code{0} gesetzt, werden keine Erstellungen
  1171. lokal durchgeführt, stattdessen lagert der Daemon sie nur aus (@pxref{Auslagern des Daemons einrichten}) oder sie schlagen einfach fehl.
  1172. @item --max-silent-time=@var{Sekunden}
  1173. Wenn der Erstellungs- oder Substitutionsprozess länger als
  1174. @var{Sekunden}-lang keine Ausgabe erzeugt, wird er abgebrochen und ein
  1175. Fehler beim Erstellen gemeldet.
  1176. Der Vorgabewert ist @code{0}, was bedeutet, dass es keine Zeitbeschränkung
  1177. gibt.
  1178. Clients können einen anderen Wert als den hier angegebenen verwenden lassen
  1179. (@pxref{Gemeinsame Erstellungsoptionen, @code{--max-silent-time}}).
  1180. @item --timeout=@var{Sekunden}
  1181. Entsprechend wird hier der Erstellungs- oder Substitutionsprozess
  1182. abgebrochen und als Fehlschlag gemeldet, wenn er mehr als
  1183. @var{Sekunden}-lang dauert.
  1184. Der Vorgabewert ist @code{0}, was bedeutet, dass es keine Zeitbeschränkung
  1185. gibt.
  1186. Clients können einen anderen Wert verwenden lassen (@pxref{Gemeinsame Erstellungsoptionen, @code{--timeout}}).
  1187. @item --rounds=@var{N}
  1188. Jede Ableitung @var{n}-mal hintereinander erstellen und einen Fehler melden,
  1189. wenn nacheinander ausgewertete Erstellungsergebnisse nicht Bit für Bit
  1190. identisch sind. Beachten Sie, dass Clients wie @command{guix build} einen
  1191. anderen Wert verwenden lassen können (@pxref{Aufruf von guix build}).
  1192. Wenn dies zusammen mit @option{--keep-failed} benutzt wird, bleiben die sich
  1193. unterscheidenden Ausgaben im Store unter dem Namen
  1194. @file{/gnu/store/@dots{}-check}. Dadurch können Unterschiede zwischen den
  1195. beiden Ergebnissen leicht erkannt werden.
  1196. @item --debug
  1197. Informationen zur Fehlersuche ausgeben.
  1198. Dies ist nützlich, um Probleme beim Starten des Daemons nachzuvollziehen;
  1199. Clients könn aber auch ein abweichenden Wert verwenden lassen, zum Beispiel
  1200. mit der Befehlszeilenoption @code{--verbosity} von @command{guix build}
  1201. (@pxref{Aufruf von guix build}).
  1202. @item --chroot-directory=@var{Verzeichnis}
  1203. Füge das @var{Verzeichnis} zum chroot von Erstellungen hinzu.
  1204. Dadurch kann sich das Ergebnis von Erstellungsprozessen ändern — zum
  1205. Beispiel, wenn diese optionale Abhängigkeiten aus dem @var{Verzeichnis}
  1206. verwenden, wenn sie verfügbar sind, und nicht, wenn es fehlt. Deshalb ist es
  1207. nicht empfohlen, dass Sie diese Befehlszeilenoption verwenden, besser
  1208. sollten Sie dafür sorgen, dass jede Ableitung alle von ihr benötigten
  1209. Eingabgen deklariert.
  1210. @item --disable-chroot
  1211. Erstellungen ohne chroot durchführen.
  1212. Diese Befehlszeilenoption zu benutzen, wird nicht empfohlen, denn auch
  1213. dadurch bekämen Erstellungsprozesse Zugriff auf nicht deklarierte
  1214. Abhängigkeiten. Sie ist allerdings unvermeidlich, wenn @command{guix-daemon}
  1215. auf einem Benutzerkonto ohne ausreichende Berechtigungen ausgeführt wird.
  1216. @item --log-compression=@var{Typ}
  1217. Erstellungsprotokolle werden entsprechend dem @var{Typ} komprimiert, der
  1218. entweder @code{gzip}, @code{bzip2} oder @code{none} (für keine Kompression)
  1219. sein muss.
  1220. Sofern nicht @code{--lose-logs} angegeben wurde, werden alle
  1221. Erstellungsprotokolle in der @var{localstatedir} gespeichert. Um Platz zu
  1222. sparen, komprimiert sie der Daemon standardmäßig automatisch mit bzip2.
  1223. @item --disable-deduplication
  1224. @cindex Deduplizieren
  1225. Automatische Dateien-»Deduplizierung« im Store ausschalten.
  1226. Standardmäßig werden zum Store hinzugefügte Objekte automatisch
  1227. »dedupliziert«: Wenn eine neue Datei mit einer anderen im Store
  1228. übereinstimmt, wird die neue Datei stattdessen als harte Verknüpfung auf die
  1229. andere Datei angelegt. Dies reduziert den Speicherverbrauch auf der Platte
  1230. merklich, jedoch steigt andererseits die Auslastung bei der Ein-/Ausgabe im
  1231. Erstellungsprozess geringfügig. Durch diese Option wird keine solche
  1232. Optimierung durchgeführt.
  1233. @item --gc-keep-outputs[=yes|no]
  1234. Gibt an, ob der Müllsammler (Garbage Collector, GC) die Ausgaben lebendiger
  1235. Ableitungen behalten muss (»yes«) oder nicht (»no«).
  1236. @cindex GC-Wurzeln
  1237. @cindex Müllsammlerwurzeln
  1238. When set to ``yes'', the GC will keep the outputs of any live derivation
  1239. available in the store---the @code{.drv} files. The default is ``no'',
  1240. meaning that derivation outputs are kept only if they are reachable from a
  1241. GC root. @xref{Aufruf von guix gc}, for more on GC roots.
  1242. @item --gc-keep-derivations[=yes|no]
  1243. Gibt an, ob der Müllsammler (GC) Ableitungen behalten muss (»yes«), wenn sie
  1244. lebendige Ausgaben haben, oder nicht (»no«).
  1245. Für »yes«, den Vorgabewert, behält der Müllsammler Ableitungen —
  1246. z.B. @code{.drv}-Dateien —, solange zumindest eine ihrer Ausgaben lebendig
  1247. ist. Dadurch können Nutzer den Ursprung der Dateien in ihrem Store
  1248. nachvollziehen. Setzt man den Wert auf »no«, wird ein bisschen weniger
  1249. Speicher auf der Platte verbraucht.
  1250. In this way, setting @code{--gc-keep-derivations} to ``yes'' causes liveness
  1251. to flow from outputs to derivations, and setting @code{--gc-keep-outputs} to
  1252. ``yes'' causes liveness to flow from derivations to outputs. When both are
  1253. set to ``yes'', the effect is to keep all the build prerequisites (the
  1254. sources, compiler, libraries, and other build-time tools) of live objects in
  1255. the store, regardless of whether these prerequisites are reachable from a GC
  1256. root. This is convenient for developers since it saves rebuilds or
  1257. downloads.
  1258. @item --impersonate-linux-2.6
  1259. Auf Linux-basierten Systemen wird hiermit vorgetäuscht, dass es sich um
  1260. Linux 2.6 handeln würde, indem der Kernel für einen
  1261. @code{uname}-Systemaufruf als Version der Veröffentlichung mit 2.6
  1262. antwortet.
  1263. Dies kann hilfreich sein, um Programme zu erstellen, die (normalerweise zu
  1264. Unrecht) von der Kernel-Versionsnummer abhängen.
  1265. @item --lose-logs
  1266. Keine Protokolle der Erstellungen vorhalten. Normalerweise würden solche in
  1267. @code{@var{localstatedir}/guix/log} gespeichert.
  1268. @item --system=@var{System}
  1269. Verwende @var{System} als aktuellen Systemtyp. Standardmäßig ist dies das
  1270. Paar aus Befehlssatz und Kernel, welches beim Aufruf von @code{configure}
  1271. erkannt wurde, wie zum Beispiel @code{x86_64-linux}.
  1272. @item --listen=@var{Endpunkt}
  1273. Lausche am @var{Endpunkt} auf Verbindungen. Dabei wird der @var{Endpunkt}
  1274. als Dateiname eines Unix-Sockets verstanden, wenn er mit einem @code{/}
  1275. (Schrägstrich) beginnt. Andernfalls wird der @var{Endpunkt} als Hostname
  1276. oder als Hostname-Port-Paar verstanden, auf dem gelauscht wird. Hier sind
  1277. ein paar Beispiele:
  1278. @table @code
  1279. @item --listen=/gnu/var/daemon
  1280. Lausche auf Verbindungen am Unix-Socket @file{/gnu/var/daemon}, falls nötig
  1281. wird er dazu erstellt.
  1282. @item --listen=localhost
  1283. @cindex Daemon, Fernzugriff
  1284. @cindex Fernzugriff auf den Daemon
  1285. @cindex Daemon, Einrichten auf Clustern
  1286. @cindex Cluster, Einrichtung des Daemons
  1287. Lausche auf TCP-Verbindungen an der Netzwerkschnittstelle, die
  1288. @code{localhost} entspricht, auf Port 44146.
  1289. @item --listen=128.0.0.42:1234
  1290. Lausche auf TCP-Verbindungen an der Netzwerkschnittstelle, die
  1291. @code{128.0.0.42} entspricht, auf Port 1234.
  1292. @end table
  1293. Diese Befehlszeilenoption kann mehrmals wiederholt werden. In diesem Fall
  1294. akzeptiert @command{guix-daemon} Verbindungen auf allen angegebenen
  1295. Endpunkten. Benutzer können bei Client-Befehlen angeben, mit welchem
  1296. Endpunkt sie sich verbinden möchten, indem sie die Umgebungsvariable
  1297. @code{GUIX_DAEMON_SOCKET} festlegen (@pxref{Der Store,
  1298. @code{GUIX_DAEMON_SOCKET}}).
  1299. @quotation Anmerkung
  1300. Das Daemon-Protokoll ist @emph{weder authentifiziert noch
  1301. verschlüsselt}. Die Benutzung von @code{--listen=@var{Host}} eignet sich für
  1302. lokale Netzwerke, wie z.B. in Rechen-Clustern, wo sich nur solche Knoten mit
  1303. dem Daemon verbinden, denen man vertraut. In Situationen, wo ein Fernzugriff
  1304. auf den Daemon durchgeführt wird, empfehlen wir, über Unix-Sockets in
  1305. Verbindung mit SSH zuzugreifen.
  1306. @end quotation
  1307. Wird @code{--listen} nicht angegeben, lauscht @command{guix-daemon} auf
  1308. Verbindungen auf dem Unix-Socket, der sich unter
  1309. @file{@var{localstatedir}/guix/daemon-socket/socket} befindet.
  1310. @end table
  1311. @node Anwendungen einrichten
  1312. @section Anwendungen einrichten
  1313. @cindex Fremddistribution
  1314. Läuft Guix aufgesetzt auf einer GNU/Linux-Distribution außer GuixSD — einer
  1315. sogenannten @dfn{Fremddistribution} —, so sind ein paar zusätzliche Schritte
  1316. bei der Einrichtung nötig. Hier finden Sie manche davon.
  1317. @subsection Locales
  1318. @anchor{locales-and-locpath}
  1319. @cindex Locales, nicht auf GuixSD
  1320. @vindex LOCPATH
  1321. @vindex GUIX_LOCPATH
  1322. Über Guix installierte Pakete benutzen nicht die Daten zu Regions- und
  1323. Spracheinstellungen (Locales) des Wirtssystems. Stattdessen müssen Sie erst
  1324. eines der Locale-Pakete installieren, die für Guix verfügbar sind, und dann
  1325. den Wert Ihrer Umgebungsvariablen @code{GUIX_LOCPATH} passend festlegen:
  1326. @example
  1327. $ guix package -i glibc-locales
  1328. $ export GUIX_LOCPATH=$HOME/.guix-profile/lib/locale
  1329. @end example
  1330. Beachten Sie, dass das Paket @code{glibc-locales} Daten für alle von
  1331. GNU@tie{}libc unterstützten Locales enthält und deswegen um die 110@tie{}MiB
  1332. wiegt. Alternativ gibt es auch @code{glibc-utf8-locales}, was kleiner, aber
  1333. auf ein paar UTF-8-Locales beschränkt ist.
  1334. Die Variable @code{GUIX_LOCPATH} spielt eine ähnliche Rolle wie
  1335. @code{LOCPATH} (@pxref{Locale Names, @code{LOCPATH},, libc, The GNU C
  1336. Library Reference Manual}). Es gibt jedoch zwei wichtige Unterschiede:
  1337. @enumerate
  1338. @item
  1339. @code{GUIX_LOCPATH} wird nur von der libc in Guix beachtet und nicht der von
  1340. Fremddistributionen bereitgestellten libc. Mit @code{GUIX_LOCPATH} können
  1341. Sie daher sicherstellen, dass die Programme der Fremddistribution keine
  1342. inkompatiblen Locale-Daten von Guix laden.
  1343. @item
  1344. libc hängt an jeden @code{GUIX_LOCPATH}-Eintrag @code{/X.Y} an, wobei
  1345. @code{X.Y} die Version von libc ist — z.B. @code{2.22}. Sollte Ihr
  1346. Guix-Profil eine Mischung aus Programmen enthalten, die an verschiedene
  1347. libc-Versionen gebunden sind, wird jede nur die Locale-Daten im richtigen
  1348. Format zu laden versuchen.
  1349. @end enumerate
  1350. Das ist wichtig, weil das Locale-Datenformat verschiedener libc-Versionen
  1351. inkompatibel sein könnte.
  1352. @subsection Name Service Switch
  1353. @cindex Name Service Switch, glibc
  1354. @cindex NSS (Name Service Switch), glibc
  1355. @cindex nscd (Name Service Caching Daemon)
  1356. @cindex Name Service Caching Daemon (nscd)
  1357. Wenn Sie Guix auf einer Fremddistribution verwenden, @emph{empfehlen wir
  1358. stärkstens}, dass Sie den @dfn{Name Service Cache Daemon} der
  1359. GNU-C-Bibliothek, @command{nscd}, laufen lassen, welcher auf dem Socket
  1360. @file{/var/run/nscd/socket} lauschen sollte. Wenn Sie das nicht tun, könnten
  1361. mit Guix installierte Anwendungen Probleme beim Auflösen von Hostnamen oder
  1362. Benutzerkonten haben, oder sogar abstürzen. Die nächsten Absätze erklären
  1363. warum.
  1364. @cindex @file{nsswitch.conf}
  1365. Die GNU-C-Bibliothek implementiert einen @dfn{Name Service Switch} (NSS),
  1366. welcher einen erweiterbaren Mechanismus zur allgemeinen »Namensauflösung«
  1367. darstellt: Hostnamensauflösung, Benutzerkonten und weiteres (@pxref{Name Service Switch,,, libc, The GNU C Library Reference Manual}).
  1368. @cindex Network Information Service (NIS)
  1369. @cindex NIS (Network Information Service)
  1370. Für die Erweiterbarkeit unterstützt der NSS @dfn{Plugins}, welche neue
  1371. Implementierungen zur Namensauflösung bieten: Zum Beispiel ermöglicht das
  1372. Plugin @code{nss-mdns} die Namensauflösung für @code{.local}-Hostnamen, das
  1373. Plugin @code{nis} gestattet die Auflösung von Benutzerkonten über den
  1374. Network Information Service (NIS) und so weiter. Diese zusätzlichen
  1375. »Auflösungsdienste« werden systemweit konfiguriert in
  1376. @file{/etc/nsswitch.conf} und alle auf dem System laufenden Programme halten
  1377. sich an diese Einstellungen (@pxref{NSS Configuration File,,, libc, The GNU
  1378. C Reference Manual}).
  1379. Wenn sie eine Namensauflösung durchführen — zum Beispiel, indem sie die
  1380. @code{getaddrinfo}-Funktion in C aufrufen — versuchen die Anwendungen als
  1381. Erstes, sich mit dem nscd zu verbinden; ist dies erfolgreich, führt nscd für
  1382. sie die weiteren Namensauflösungen durch. Falls nscd nicht läuft, führen sie
  1383. selbst die Namensauflösungen durch, indem sie die Namensauflösungsdienste in
  1384. ihren eigenen Adressraum laden und ausführen. Diese Namensauflösungsdienste
  1385. — die @file{libnss_*.so}-Dateien — werden mit @code{dlopen} geladen, aber
  1386. sie kommen von der C-Bibliothek des Wirtssystems und nicht von der
  1387. C-Bibliothek, mit der die Anwendung gebunden wurde (also der C-Bibliothek
  1388. von Guix).
  1389. Und hier kommt es zum Problem: Wenn die Anwendung mit der C-Bibliothek von
  1390. Guix (etwa glibc 2.24) gebunden wurde und die NSS-Plugins von einer anderen
  1391. C-Bibliothek (etwa @code{libnss_mdns.so} für glibc 2.22) zu laden versucht,
  1392. wird sie vermutlich abstürzen oder die Namensauflösungen werden unerwartet
  1393. fehlschlagen.
  1394. Durch das Ausführen von @command{nscd} auf dem System wird, neben anderen
  1395. Vorteilen, dieses Problem der binären Inkompatibilität vermieden, weil diese
  1396. @code{libnss_*.so}-Dateien vom @command{nscd}-Prozess geladen werden, nicht
  1397. in den Anwendungen selbst.
  1398. @subsection X11-Schriftarten
  1399. @cindex Schriftarten
  1400. Die Mehrheit der graphischen Anwendungen benutzen Fontconfig zum Finden und
  1401. Laden von Schriftarten und für die Darstellung im X11-Client. Im Paket
  1402. @code{fontconfig} in Guix werden Schriftarten standardmäßig in
  1403. @file{$HOME/.guix-profile} gesucht. Um es graphischen Anwendungen, die mit
  1404. Guix installiert wurden, zu ermöglichen, Schriftarten anzuzeigen, müssen Sie
  1405. die Schriftarten auch mit Guix installieren. Essenzielle Pakete für
  1406. Schriftarten sind unter Anderem @code{gs-fonts}, @code{font-dejavu} und
  1407. @code{font-gnu-freefont-ttf}.
  1408. Um auf Chinesisch, Japanisch oder Koreanisch verfassten Text in graphischen
  1409. Anwendungen anzeigen zu können, möchten Sie vielleicht
  1410. @code{font-adobe-source-han-sans} oder @code{font-wqy-zenhei}
  1411. installieren. Ersteres hat mehrere Ausgaben, für jede Sprachfamilie eine
  1412. (@pxref{Pakete mit mehreren Ausgaben.}). Zum Beispiel installiert folgender
  1413. Befehl Schriftarten für chinesische Sprachen:
  1414. @example
  1415. guix package -i font-adobe-source-han-sans:cn
  1416. @end example
  1417. @cindex @code{xterm}
  1418. Ältere Programme wie @command{xterm} benutzen kein Fontconfig, sondern
  1419. X-Server-seitige Schriftartendarstellung. Solche Programme setzen voraus,
  1420. dass der volle Name einer Schriftart mit XLFD (X Logical Font Description)
  1421. angegeben wird, z.B. so:
  1422. @example
  1423. -*-dejavu sans-medium-r-normal-*-*-100-*-*-*-*-*-1
  1424. @end example
  1425. Um solche vollen Namen für die in Ihrem Guix-Profil installierten
  1426. TrueType-Schriftarten zu verwenden, müssen Sie den Pfad für Schriftarten
  1427. (Font Path) des X-Servers anpassen:
  1428. @c Note: 'xset' does not accept symlinks so the trick below arranges to
  1429. @c get at the real directory. See <https://bugs.gnu.org/30655>.
  1430. @example
  1431. xset +fp $(dirname $(readlink -f ~/.guix-profile/share/fonts/truetype/fonts.dir))
  1432. @end example
  1433. @cindex @code{xlsfonts}
  1434. Danach können Sie den Befehl @code{xlsfonts} ausführen (aus dem Paket
  1435. @code{xlsfonts}), um sicherzustellen, dass dort Ihre TrueType-Schriftarten
  1436. aufgeführt sind.
  1437. @cindex @code{fc-cache}
  1438. @cindex Font-Cache
  1439. Nach der Installation der Schriftarten müssen Sie unter Umständen den
  1440. Schriftarten-Zwischenspeicher (Font-Cache) erneuern, um diese in Anwendungen
  1441. benutzen zu können. Gleiches gilt, wenn mit Guix installierte Anwendungen
  1442. anscheinend keine Schriftarten finden können. Um das Erneuern des
  1443. Font-Caches zu erzwingen, führen Sie @code{fc-cache -f} aus. Der Befehl
  1444. @code{fc-cache} wird vom Paket @code{fontconfig} angeboten.
  1445. @subsection X.509-Zertifikate
  1446. @cindex @code{nss-certs}
  1447. Das Paket @code{nss-certs} bietet X.509-Zertifikate, womit Programme die
  1448. Identität von Web-Servern authentifizieren können, auf die über HTTPS
  1449. zugegriffen wird.
  1450. Wenn Sie Guix auf einer Fremddistribution verwenden, können Sie dieses Paket
  1451. installieren und die relevanten Umgebungsvariablen festlegen, damit Pakete
  1452. wissen, wo sie Zertifikate finden. In @xref{X.509-Zertifikate} stehen
  1453. genaue Informationen.
  1454. @subsection Emacs-Pakete
  1455. @cindex @code{emacs}
  1456. Wenn Sie mit Guix Pakete für Emacs installieren, werden deren elisp-Dateien
  1457. entweder in @file{$HOME/.guix-profile/share/emacs/site-lisp/} oder in
  1458. Unterverzeichnissen von
  1459. @file{$HOME/.guix-profile/share/emacs/site-lisp/guix.d/}
  1460. gespeichert. Letzteres Verzeichnis gibt es, weil es Tausende von
  1461. Emacs-Paketen gibt und sie alle im selben Verzeichnis zu speichern
  1462. vielleicht nicht verlässlich funktioniert (wegen Namenskonflikten). Daher
  1463. halten wir es für richtig, für jedes Paket ein anderes Verzeichnis zu
  1464. benutzen. Das Emacs-Paketsystem organisiert die Dateistruktur ähnlich
  1465. (@pxref{Package Files,,, emacs, The GNU Emacs Manual}).
  1466. Standardmäßig »weiß« Emacs (wenn er mit Guix installiert wurde), wo diese
  1467. Pakete liegen, Sie müssen also nichts selbst konfigurieren. Wenn Sie aber
  1468. aus irgendeinem Grund mit Guix installierte Pakete nicht automatisch laden
  1469. lassen möchten, können Sie Emacs mit der Befehlszeilenoption
  1470. @code{--no-site-file} starten (@pxref{Init File,,, emacs, The GNU Emacs
  1471. Manual}).
  1472. @subsection GCC-Toolchain
  1473. @cindex GCC
  1474. @cindex ld-wrapper
  1475. Guix bietet individuelle Compiler-Pakete wie etwa @code{gcc}, aber wenn Sie
  1476. einen vollständigen Satz an Werkzeugen zum Kompilieren und Binden von
  1477. Quellcode brauchen, werden Sie eigentlich das Paket @code{gcc-toolchain}
  1478. haben wollen. Das Paket bietet eine vollständige GCC-Toolchain für die
  1479. Entwicklung mit C/C++, einschließlich GCC selbst, der GNU-C-Bibliothek
  1480. (Header-Dateien und Binärdateien samt Symbolen zur Fehlersuche/Debugging in
  1481. der @code{debug}-Ausgabe), Binutils und einen Wrapper für den Binder/Linker.
  1482. @cindex Versuch, unreine Bibliothek zu benutzen, Fehlermeldung
  1483. Der Zweck des Wrappers ist, die an den Binder übergebenen
  1484. Befehlszeilenoptionen mit @code{-L} und @code{-l} zu überprüfen und jeweils
  1485. passende Argumente mit @code{-rpath} anzufügen, womit dann der echte Binder
  1486. aufgerufen wird. Standardmäßig weigert sich der Binder-Wrapper, mit
  1487. Bibliotheken außerhalb des Stores zu binden, um »Reinheit« zu
  1488. gewährleisten. Das kann aber stören, wenn man die Toolchain benutzt, um mit
  1489. lokalen Bibliotheken zu binden. Um Referenzen auf Bibliotheken außerhalb des
  1490. Stores zu erlauben, müssen Sie die Umgebungsvariable
  1491. @code{GUIX_LD_WRAPPER_ALLOW_IMPURITIES} setzen.
  1492. @c TODO What else?
  1493. @c *********************************************************************
  1494. @node Paketverwaltung
  1495. @chapter Paketverwaltung
  1496. @cindex Pakete
  1497. Der Zweck von GNU Guix ist, Benutzern die leichte Installation,
  1498. Aktualisierung und Entfernung von Software-Paketen zu ermöglichen, ohne dass
  1499. sie ihre Erstellungsprozeduren oder Abhängigkeiten kennen müssen. Guix kann
  1500. natürlich noch mehr als diese offensichtlichen Funktionalitäten.
  1501. Dieses Kapitel beschreibt die Hauptfunktionalitäten von Guix, sowie die von
  1502. Guix angebotenen Paketverwaltungswerkzeuge. Zusätzlich von den im Folgenden
  1503. beschriebenen Befehlszeilen-Benutzerschnittstellen (@pxref{Aufruf von guix package, @code{guix package}}) können Sie auch mit der
  1504. Emacs-Guix-Schnittstelle (@pxref{Top,,, emacs-guix, The Emacs-Guix Reference
  1505. Manual}) arbeiten, nachdem Sie das Paket @code{emacs-guix} installiert haben
  1506. (führen Sie zum Einstieg in Emacs-Guix den Emacs-Befehl @kbd{M-x guix-help}
  1507. aus):
  1508. @example
  1509. guix package -i emacs-guix
  1510. @end example
  1511. @menu
  1512. * Funktionalitäten:: Wie Guix Ihr Leben schöner machen wird.
  1513. * Aufruf von guix package:: Pakete installieren, entfernen usw.
  1514. * Substitute:: Vorerstelle Binärdateien herunterladen.
  1515. * Pakete mit mehreren Ausgaben.:: Ein Quellpaket, mehrere Ausgaben.
  1516. * Aufruf von guix gc:: Den Müllsammler laufen lassen.
  1517. * Aufruf von guix pull:: Das neueste Guix samt Distribution laden.
  1518. * Channels:: Customizing the package collection.
  1519. * Inferiors:: Interacting with another revision of Guix.
  1520. * Invoking guix describe:: Display information about your Guix revision.
  1521. * Aufruf von guix pack:: Software-Bündel erstellen.
  1522. * Aufruf von guix archive:: Import und Export von Store-Dateien.
  1523. @end menu
  1524. @node Funktionalitäten
  1525. @section Funktionalitäten
  1526. Wenn Sie Guix benutzen, landet jedes Paket schließlich im @dfn{Paket-Store}
  1527. in seinem eigenen Verzeichnis — der Name ist ähnlich wie
  1528. @file{/gnu/store/xxx-package-1.2}, wobei @code{xxx} eine Zeichenkette in
  1529. Base32-Darstellung ist.
  1530. Statt diese Verzeichnisse direkt anzugeben, haben Nutzer ihr eigenes
  1531. @dfn{Profil}, welches auf diejenigen Pakete zeigt, die sie tatsächlich
  1532. benutzen wollen. Diese Profile sind im Persönlichen Ordner des jeweiligen
  1533. Nutzers gespeichert als @code{$HOME/.guix-profile}.
  1534. Zum Beispiel installiert @code{alice} GCC 4.7.2. Dadurch zeigt dann
  1535. @file{/home/alice/.guix-profile/bin/gcc} auf
  1536. @file{/gnu/store/@dots{}-gcc-4.7.2/bin/gcc}. Auf demselben Rechner hat
  1537. @code{bob} bereits GCC 4.8.0 installiert. Das Profil von @code{bob} zeigt
  1538. dann einfach weiterhin auf @file{/gnu/store/@dots{}-gcc-4.8.0/bin/gcc} —
  1539. d.h. beide Versionen von GCC koexistieren auf demselben System, ohne sich zu
  1540. stören.
  1541. Der Befehl @command{guix package} ist das zentrale Werkzeug, um Pakete zu
  1542. verwalten (@pxref{Aufruf von guix package}). Es arbeitet auf dem eigenen
  1543. Profil jedes Nutzers und kann @emph{mit normalen Benutzerrechten} ausgeführt
  1544. werden.
  1545. @cindex Transaktionen
  1546. Der Befehl stellt die offensichtlichen Installations-, Entfernungs- und
  1547. Aktualisierungsoperationen zur Verfügung. Jeder Aufruf ist tatsächlich eine
  1548. eigene @emph{Transaktion}: Entweder die angegebene Operation wird
  1549. erfolgreich durchgeführt, oder gar nichts passiert. Wenn also der Prozess
  1550. von @command{guix package} während der Transaktion beendet wird, oder es zum
  1551. Stromausfall während der Transaktion kommt, dann bleibt der alte, nutzbare
  1552. Zustands des Nutzerprofils erhalten.
  1553. Zudem kann jede Pakettransaktion @emph{zurückgesetzt} werden
  1554. (Rollback). Wird also zum Beispiel durch eine Aktualisierung eine neue
  1555. Version eines Pakets installiert, die einen schwerwiegenden Fehler zur Folge
  1556. hat, können Nutzer ihr Profil einfach auf die vorherige Profilinstanz
  1557. zurücksetzen, von der sie wissen, dass sie gut lief. Ebenso unterliegt auf
  1558. GuixSD auch die globale Systemkonfiguration transaktionellen
  1559. Aktualisierungen und Rücksetzungen (@pxref{Das Konfigurationssystem nutzen}).
  1560. Alle Pakete im Paket-Store können vom @emph{Müllsammler} (Garbage Collector)
  1561. gelöscht werden. Guix ist in der Lage, festzustellen, welche Pakete noch
  1562. durch Benutzerprofile referenziert werden, und entfernt nur diese, die
  1563. nachweislich nicht mehr referenziert werden (@pxref{Aufruf von guix gc}). Benutzer können auch ausdrücklich alte Generationen ihres Profils
  1564. löschen, damit die zugehörigen Pakete vom Müllsammler gelöscht werden
  1565. können.
  1566. @cindex Reproduzierbarkeit
  1567. @cindex Reproduzierbare Erstellungen
  1568. Guix takes a @dfn{purely functional} approach to package management, as
  1569. described in the introduction (@pxref{Einführung}). Each
  1570. @file{/gnu/store} package directory name contains a hash of all the inputs
  1571. that were used to build that package---compiler, libraries, build scripts,
  1572. etc. This direct correspondence allows users to make sure a given package
  1573. installation matches the current state of their distribution. It also helps
  1574. maximize @dfn{build reproducibility}: thanks to the isolated build
  1575. environments that are used, a given build is likely to yield bit-identical
  1576. files when performed on different machines (@pxref{Aufruf des guix-daemon,
  1577. container}).
  1578. @cindex Substitute
  1579. Auf dieser Grundlage kann Guix @dfn{transparent Binär- oder Quelldateien
  1580. ausliefern}. Wenn eine vorerstellte Binärdatei für ein
  1581. @file{/gnu/store}-Objekt von einer externen Quelle verfügbar ist — ein
  1582. @dfn{Substitut} —, lädt Guix sie einfach herunter und entpackt sie,
  1583. andernfalls erstellt Guix das Paket lokal aus seinem Quellcode
  1584. (@pxref{Substitute}). Weil Erstellungsergebnisse normalerweise Bit für Bit
  1585. reproduzierbar sind, müssen die Nutzer den Servern, die Substitute anbieten,
  1586. nicht blind vertrauen; sie können eine lokale Erstellung erzwingen und
  1587. Substitute @emph{anfechten} (@pxref{Aufruf von guix challenge}).
  1588. Kontrolle über die Erstellungsumgebung ist eine auch für Entwickler
  1589. nützliche Funktionalität. Der Befehl @command{guix environment} ermöglicht
  1590. es Entwicklern eines Pakets, schnell die richtige Entwicklungsumgebung für
  1591. ihr Paket einzurichten, ohne manuell die Abhängigkeiten des Pakets in ihr
  1592. Profil installieren zu müssen (@pxref{Aufruf von guix environment}).
  1593. @cindex replication, of software environments
  1594. @cindex provenance tracking, of software artifacts
  1595. All of Guix and its package definitions is version-controlled, and
  1596. @command{guix pull} allows you to ``travel in time'' on the history of Guix
  1597. itself (@pxref{Aufruf von guix pull}). This makes it possible to replicate a
  1598. Guix instance on a different machine or at a later point in time, which in
  1599. turn allows you to @emph{replicate complete software environments}, while
  1600. retaining precise @dfn{provenance tracking} of the software.
  1601. @node Aufruf von guix package
  1602. @section Invoking @command{guix package}
  1603. @cindex Installieren von Paketen
  1604. @cindex Entfernen von Paketen
  1605. @cindex Paketinstallation
  1606. @cindex Paketentfernung
  1607. Der Befehl @command{guix package} ist ein Werkzeug, womit Nutzer Pakete
  1608. installieren, aktualisieren, entfernen und auf vorherige Konfigurationen
  1609. zurücksetzen können. Dabei wird nur das eigene Profil des Nutzers verwendet,
  1610. und es funktioniert mit normalen Benutzerrechten, ohne Administratorrechte
  1611. (@pxref{Funktionalitäten}). Die Syntax ist:
  1612. @example
  1613. guix package @var{Optionen}
  1614. @end example
  1615. @cindex Transaktionen
  1616. In erster Linie geben die @var{Optionen} an, welche Operationen in der
  1617. Transaktion durchgeführt werden sollen. Nach Abschluss wird ein neues Profil
  1618. erzeugt, aber vorherige @dfn{Generationen} des Profils bleiben verfügbar,
  1619. falls der Benutzer auf sie zurückwechseln will.
  1620. Um zum Beispiel @code{lua} zu entfernen und @code{guile} und
  1621. @code{guile-cairo} in einer einzigen Transaktion zu installieren:
  1622. @example
  1623. guix package -r lua -i guile guile-cairo
  1624. @end example
  1625. @command{guix package} unterstützt auch ein @dfn{deklaratives Vorgehen},
  1626. wobei der Nutzer die genaue Menge an Paketen, die verfügbar sein sollen,
  1627. festlegt und über die Befehlszeilenoption @option{--manifest} übergibt
  1628. (@pxref{profile-manifest, @option{--manifest}}).
  1629. @cindex Profil
  1630. Für jeden Benutzer wird automatisch eine symbolische Verknüpfung zu seinem
  1631. Standardprofil angelegt als @file{$HOME/.guix-profile}. Diese symbolische
  1632. Verknüpfung zeigt immer auf die aktuelle Generation des Standardprofils des
  1633. Benutzers. Somit können Nutzer @file{$HOME/.guix-profile/bin} z.B. zu ihrer
  1634. Umgebungsvariablen @code{PATH} hinzufügen.
  1635. @cindex Suchpfade
  1636. Wenn Sie nicht die Guix System Distribution benutzen, sollten Sie in
  1637. Betracht ziehen, folgende Zeilen zu Ihrem @file{~/.bash_profile}
  1638. hinzuzufügen (@pxref{Bash Startup Files,,, bash, The GNU Bash Reference
  1639. Manual}), damit in neu erzeugten Shells alle Umgebungsvariablen richtig
  1640. definiert werden:
  1641. @example
  1642. GUIX_PROFILE="$HOME/.guix-profile" ; \
  1643. source "$HOME/.guix-profile/etc/profile"
  1644. @end example
  1645. Ist Ihr System für mehrere Nutzer eingerichtet, werden Nutzerprofile an
  1646. einem Ort gespeichert, der als @dfn{Müllsammlerwurzel} registriert ist, auf
  1647. die @file{$HOME/.guix-profile} zeigt (@pxref{Aufruf von guix gc}). Dieses
  1648. Verzeichnis ist normalerweise
  1649. @code{@var{localstatedir}/guix/profiles/per-user/@var{Benutzer}}, wobei
  1650. @var{localstatedir} der an @code{configure} als @code{--localstatedir}
  1651. übergebene Wert ist und @var{Benutzer} für den jeweiligen Benutzernamen
  1652. steht. Das @file{per-user}-Verzeichnis wird erstellt, wenn
  1653. @command{guix-daemon} gestartet wird, und das Unterverzeichnis
  1654. @var{Benutzer} wird durch @command{guix package} erstellt.
  1655. Als @var{Optionen} kann vorkommen:
  1656. @table @code
  1657. @item --install=@var{Paket} @dots{}
  1658. @itemx -i @var{Paket} @dots{}
  1659. Die angegebenen @var{Paket}e installieren.
  1660. Jedes @var{Paket} kann entweder einfach durch seinen Paketnamen aufgeführt
  1661. werden, wie @code{guile}, oder als Paketname gefolgt von einem At-Zeichen @@
  1662. und einer Versionsnummer, wie @code{guile@@1.8.8} oder auch nur
  1663. @code{guile@@1.8} (in letzterem Fall wird die neueste Version mit Präfix
  1664. @code{1.8} ausgewählt.)
  1665. Wird keine Versionsnummer angegeben, wird die neueste verfügbare Version
  1666. ausgewählt. Zudem kann im @var{Paket} ein Doppelpunkt auftauchen, gefolgt
  1667. vom Namen einer der Ausgaben des Pakets, wie @code{gcc:doc} oder
  1668. @code{binutils@@2.22:lib} (@pxref{Pakete mit mehreren Ausgaben.}). Pakete
  1669. mit zugehörigem Namen (und optional der Version) werden unter den Modulen
  1670. der GNU-Distribution gesucht (@pxref{Paketmodule}).
  1671. @cindex propagierte Eingaben
  1672. Manchmal haben Pakete @dfn{propagierte Eingaben}: Als solche werden
  1673. Abhängigkeiten bezeichnet, die automatisch zusammen mit dem angeforderten
  1674. Paket installiert werden (im Abschnitt @pxref{package-propagated-inputs,
  1675. @code{propagated-inputs} in @code{package} objects} sind weitere
  1676. Informationen über propagierte Eingaben in Paketdefinitionen zu finden).
  1677. @anchor{package-cmd-propagated-inputs}
  1678. Ein Beispiel ist die GNU-MPC-Bibliothek: Ihre C-Headerdateien verweisen auf
  1679. die der GNU-MPFR-Bibliothek, welche wiederum auf die der GMP-Bibliothek
  1680. verweisen. Wenn also MPC installiert wird, werden auch die MPFR- und
  1681. GMP-Bibliotheken in das Profil installiert; entfernt man MPC, werden auch
  1682. MPFR und GMP entfernt — außer sie wurden noch auf andere Art ausdrücklich
  1683. vom Nutzer installiert.
  1684. Abgesehen davon setzen Pakete manchmal die Definition von Umgebungsvariablen
  1685. für ihre Suchpfade voraus (siehe die Erklärung von @code{--search-paths}
  1686. weiter unten). Alle fehlenden oder womöglich falschen Definitionen von
  1687. Umgebungsvariablen werden hierbei gemeldet.
  1688. @item --install-from-expression=@var{Ausdruck}
  1689. @itemx -e @var{Ausdruck}
  1690. Das Paket installieren, zu dem der @var{Ausdruck} ausgewertet wird.
  1691. Beim @var{Ausdruck} muss es sich um einen Scheme-Ausdruck handeln, der zu
  1692. einem @code{<package>}-Objekt ausgewertet wird. Diese Option ist besonders
  1693. nützlich, um zwischen gleichnamigen Varianten eines Pakets zu unterscheiden,
  1694. durch Ausdrücke wie @code{(@@ (gnu packages base) guile-final)}.
  1695. Beachten Sie, dass mit dieser Option die erste Ausgabe des angegebenen
  1696. Pakets installiert wird, was unzureichend sein kann, wenn eine bestimmte
  1697. Ausgabe eines Pakets mit mehreren Ausgaben gewünscht ist.
  1698. @item --install-from-file=@var{Datei}
  1699. @itemx -f @var{Datei}
  1700. Das Paket installieren, zu dem der Code in der @var{Datei} ausgewertet wird.
  1701. Zum Beispiel könnte die @var{Datei} eine Definition wie diese enthalten
  1702. (@pxref{Pakete definieren}):
  1703. @example
  1704. @verbatiminclude package-hello.scm
  1705. @end example
  1706. Entwickler könnten es für nützlich erachten, eine solche
  1707. @file{guix.scm}-Datei im Quellbaum ihres Projekts abzulegen, mit der
  1708. Zwischenstände der Entwicklung getestet und reproduzierbare
  1709. Erstellungsumgebungen aufgebaut werden können (@pxref{Aufruf von guix environment}).
  1710. @item --remove=@var{Paket} @dots{}
  1711. @itemx -r @var{Paket} @dots{}
  1712. Die angegebenen @var{Paket}e entfernen.
  1713. Wie auch bei @code{--install} kann jedes @var{Paket} neben dem Paketnamen
  1714. auch eine Versionsnummer und/oder eine Ausgabe benennen. Zum Beispiel würde
  1715. @code{-r glibc:debug} die @code{debug}-Ausgabe von @code{glibc} aus dem
  1716. Profil entfernen.
  1717. @item --upgrade[=@var{Regexp} @dots{}]
  1718. @itemx -u [@var{Regexp} @dots{}]
  1719. @cindex Pakete aktualisieren
  1720. Alle installierten Pakete aktualisieren. Wenn einer oder mehr reguläre
  1721. Ausdrücke (Regexps) angegeben wurden, werden nur diejenigen installierten
  1722. Pakete aktualisiert, deren Name zu einer der @var{Regexp}s passt. Siehe auch
  1723. weiter unten die Befehlszeilenoption @code{--do-not-upgrade}.
  1724. Beachten Sie, dass das Paket so auf die neueste Version unter den Paketen
  1725. gebracht wird, die in der aktuell installierten Distribution vorliegen. Um
  1726. jedoch Ihre Distribution zu aktualisieren, sollten Sie regelmäßig
  1727. @command{guix pull} ausführen (@pxref{Aufruf von guix pull}).
  1728. @item --do-not-upgrade[=@var{Regexp} @dots{}]
  1729. In Verbindung mit der Befehlszeilenoption @code{--upgrade}, führe
  1730. @emph{keine} Aktualisierung von Paketen durch, deren Name zum regulären
  1731. Ausdruck @var{Regexp} passt. Um zum Beispiel alle Pakete im aktuellen Profil
  1732. zu aktualisieren mit Ausnahme derer, die »emacs« im Namen haben:
  1733. @example
  1734. $ guix package --upgrade . --do-not-upgrade emacs
  1735. @end example
  1736. @item @anchor{profile-manifest}--manifest=@var{Datei}
  1737. @itemx -m @var{Datei}
  1738. @cindex Profildeklaration
  1739. @cindex Profilmanifest
  1740. Erstellt eine neue Generation des Profils aus dem vom Scheme-Code in
  1741. @var{Datei} gelieferten Manifest-Objekt.
  1742. Dadurch könnrn Sie den Inhalt des Profils @emph{deklarieren}, statt ihn
  1743. durch eine Folge von Befehlen wie @code{--install} u.Ä. zu generieren. Der
  1744. Vorteil ist, dass die @var{Datei} unter Versionskontrolle gestellt werden
  1745. kann, auf andere Maschinen zum Reproduzieren desselben Profils kopiert
  1746. werden kann und Ähnliches.
  1747. @c FIXME: Add reference to (guix profile) documentation when available.
  1748. Der Code in der @var{Datei} muss ein @dfn{Manifest}-Objekt liefern, was
  1749. ungefähr einer Liste von Paketen entspricht:
  1750. @findex packages->manifest
  1751. @example
  1752. (use-package-modules guile emacs)
  1753. (packages->manifest
  1754. (list emacs
  1755. guile-2.0
  1756. ;; Eine bestimmte Paketausgabe nutzen.
  1757. (list guile-2.0 "debug")))
  1758. @end example
  1759. @findex specifications->manifest
  1760. In diesem Beispiel müssen wir wissen, welche Module die Variablen
  1761. @code{emacs} und @code{guile-2.0} definieren, um die richtige Angabe mit
  1762. @code{use-package-modules} machen zu können, was umständlich sein kann. Wir
  1763. können auch normale Paketnamen angeben und sie durch
  1764. @code{specifications->manifest} zu den entsprechenden Paketobjekten
  1765. auflösen, zum Beispiel so:
  1766. @example
  1767. (specifications->manifest
  1768. '("emacs" "guile@@2.2" "guile@@2.2:debug"))
  1769. @end example
  1770. @item --roll-back
  1771. @cindex rücksetzen
  1772. @cindex Zurücksetzen von Transaktionen
  1773. @cindex Transaktionen, zurücksetzen
  1774. Wechselt zur vorherigen @dfn{Generation} des Profils zurück — d.h. macht die
  1775. letzte Transaktion rückgängig.
  1776. In Verbindung mit Befehlszeilenoptionen wie @code{--install} wird zuerst
  1777. zurückgesetzt, bevor andere Aktionen durchgeführt werden.
  1778. Ein Rücksetzen der ersten Generation, die installierte Pakete enthält,
  1779. wechselt das Profil zur @dfn{nullten Generation}, die keinerlei Dateien
  1780. enthält, abgesehen von Metadaten über sich selbst.
  1781. Nach dem Zurücksetzen überschreibt das Installieren, Entfernen oder
  1782. Aktualisieren von Paketen vormals zukünftige Generationen, d.h. der Verlauf
  1783. der Generationen eines Profils ist immer linear.
  1784. @item --switch-generation=@var{Muster}
  1785. @itemx -S @var{Muster}
  1786. @cindex Generationen
  1787. Wechselt zu der bestimmten Generation, die durch das @var{Muster} bezeichnet
  1788. wird.
  1789. Als @var{Muster} kann entweder die Nummer einer Generation oder eine Nummer
  1790. mit vorangestelltem »+« oder »-« dienen. Letzteres springt die angegebene
  1791. Anzahl an Generationen vor oder zurück. Zum Beispiel kehrt
  1792. @code{--switch-generation=+1} nach einem Zurücksetzen wieder zur neueren
  1793. Generation zurück.
  1794. Der Unterschied zwischen @code{--roll-back} und
  1795. @code{--switch-generation=-1} ist, dass @code{--switch-generation} keine
  1796. nullte Generation erzeugen wird; existiert die angegebene Generation nicht,
  1797. bleibt schlicht die aktuelle Generation erhalten.
  1798. @item --search-paths[=@var{Art}]
  1799. @cindex Suchpfade
  1800. Führe die Definitionen von Umgebungsvariablen auf, in Bash-Syntax, die nötig
  1801. sein könnten, um alle installierten Pakete nutzen zu können. Diese
  1802. Umgebungsvariablen werden benutzt, um die @dfn{Suchpfade} für Dateien
  1803. festzulegen, die von einigen installierten Paketen benutzt werden.
  1804. Zum Beispiel braucht GCC die Umgebungsvariablen @code{CPATH} und
  1805. @code{LIBRARY_PATH}, um zu wissen, wo sich im Benutzerprofil Header und
  1806. Bibliotheken befinden (@pxref{Environment Variables,,, gcc, Using the GNU
  1807. Compiler Collection (GCC)}). Wenn GCC und, sagen wir, die C-Bibliothek im
  1808. Profil installiert sind, schlägt @code{--search-paths} also vor, diese
  1809. Variablen jeweils auf @code{@var{profile}/include} und
  1810. @code{@var{profile}/lib} verweisen zu lassen.
  1811. Die typische Nutzung ist, in der Shell diese Variablen zu definieren:
  1812. @example
  1813. $ eval `guix package --search-paths`
  1814. @end example
  1815. Als @var{Art} kann entweder @code{exact}, @code{prefix} oder @code{suffix}
  1816. gewählt werden, wodurch die gelieferten Definitionen der Umgebungsvariablen
  1817. entweder exakt die Einstellungen für Guix meldet, oder sie als Präfix oder
  1818. Suffix an den aktuellen Wert dieser Variablen anhängt. Gibt man keine
  1819. @var{Art} an, wird der Vorgabewert @code{exact} verwendet.
  1820. Diese Befehlszeilenoption kann auch benutzt werden, um die
  1821. @emph{kombinierten} Suchpfade mehrerer Profile zu berechnen. Betrachten Sie
  1822. dieses Beispiel:
  1823. @example
  1824. $ guix package -p foo -i guile
  1825. $ guix package -p bar -i guile-json
  1826. $ guix package -p foo -p bar --search-paths
  1827. @end example
  1828. Der letzte Befehl oben meldet auch die Definition der Umgebungsvariablen
  1829. @code{GUILE_LOAD_PATH}, obwohl für sich genommen weder @file{foo} noch
  1830. @file{bar} zu dieser Empfehlung führen würden.
  1831. @item --profile=@var{Profil}
  1832. @itemx -p @var{Profil}
  1833. Auf @var{Profil} anstelle des Standardprofils des Benutzers arbeiten.
  1834. @cindex Kollisionen, in einem Profil
  1835. @cindex Paketkollisionen in Profilen
  1836. @cindex Profilkollisionen
  1837. @item --allow-collisions
  1838. Kollidierende Pakete im neuen Profil zulassen. Benutzung auf eigene Gefahr!
  1839. Standardmäßig wird @command{guix package} @dfn{Kollisionen} als Fehler
  1840. auffassen und melden. Zu Kollisionen kommt es, wenn zwei oder mehr
  1841. verschiedene Versionen oder Varianten desselben Pakets im Profil landen.
  1842. @item --verbose
  1843. Erzeugt ausführliche Textausgaben. Insbesondere wird auch das
  1844. Erstellungsprotokoll der Umgebung auf dem Standard-Fehler-Port (stderr)
  1845. ausgegeben.
  1846. @item --bootstrap
  1847. Erstellt das Profil mit dem Bootstrap-Guile. Diese Option ist nur für
  1848. Entwickler der Distribution nützlich.
  1849. @end table
  1850. Zusätzlich zu diesen Aktionen unterstützt @command{guix package} folgende
  1851. Befehlszeilenoptionen, um den momentanen Zustand eines Profils oder die
  1852. Verfügbarkeit von Paketen nachzulesen:
  1853. @table @option
  1854. @item --search=@var{Regexp}
  1855. @itemx -s @var{Regexp}
  1856. @cindex Suche nach Paketen
  1857. Führt alle verfügbaren Pakete auf, deren Name, Zusammenfassung oder
  1858. Beschreibung zum regulären Ausdruck @var{Regexp} passt, sortiert nach ihrer
  1859. Relevanz. Alle Metadaten passender Pakete werden im @code{recutils}-Format
  1860. geliefert (@pxref{Top, GNU recutils databases,, recutils, GNU recutils
  1861. manual}).
  1862. So können bestimmte Felder mit dem Befehl @command{recsel} extrahiert
  1863. werden, zum Beispiel:
  1864. @example
  1865. $ guix package -s malloc | recsel -p name,version,relevance
  1866. name: jemalloc
  1867. version: 4.5.0
  1868. relevance: 6
  1869. name: glibc
  1870. version: 2.25
  1871. relevance: 1
  1872. name: libgc
  1873. version: 7.6.0
  1874. relevance: 1
  1875. @end example
  1876. Ebenso kann der Name aller zu den Bedingungen der GNU@tie{}LGPL, Version 3,
  1877. verfügbaren Pakete ermittelt werden:
  1878. @example
  1879. $ guix package -s "" | recsel -p name -e 'license ~ "LGPL 3"'
  1880. name: elfutils
  1881. name: gmp
  1882. @dots{}
  1883. @end example
  1884. Es ist auch möglich, Suchergebnisse näher einzuschränken, indem Sie
  1885. @code{-s} mehrmals übergeben. Zum Beispiel liefert folgender Befehl eines
  1886. Liste von Brettspielen:
  1887. @example
  1888. $ guix package -s '\<board\>' -s game | recsel -p name
  1889. name: gnubg
  1890. @dots{}
  1891. @end example
  1892. Würden wir @code{-s game} weglassen, bekämen wir auch Software-Pakete
  1893. aufgelistet, die mit »printed circuit boards« (elektronischen Leiterplatten)
  1894. zu tun haben; ohne die spitzen Klammern um @code{board} bekämen wir auch
  1895. Pakete, die mit »keyboards« (Tastaturen, oder musikalischen Keyboard) zu tun
  1896. haben.
  1897. Es ist Zeit für ein komplexeres Beispiel. Folgender Befehl sucht
  1898. kryptographische Bibliotheken, filtert Haskell-, Perl-, Python- und
  1899. Ruby-Bibliotheken heraus und gibt Namen und Zusammenfassung passender Pakete
  1900. aus:
  1901. @example
  1902. $ guix package -s crypto -s library | \
  1903. recsel -e '! (name ~ "^(ghc|perl|python|ruby)")' -p name,synopsis
  1904. @end example
  1905. @noindent
  1906. @xref{Selection Expressions,,, recutils, GNU recutils manual} enthält
  1907. weitere Informationen über @dfn{Auswahlausdrücke} mit @code{recsel -e}.
  1908. @item --show=@var{Paket}
  1909. Zeigt Details über das @var{Paket} aus der Liste verfügbarer Pakete, im
  1910. @code{recutils}-Format (@pxref{Top, GNU recutils databases,, recutils, GNU
  1911. recutils manual}).
  1912. @example
  1913. $ guix package --show=python | recsel -p name,version
  1914. name: python
  1915. version: 2.7.6
  1916. name: python
  1917. version: 3.3.5
  1918. @end example
  1919. Sie können auch den vollständigen Namen eines Pakets angeben, um Details nur
  1920. über diese Version angezeigt zu bekommen:
  1921. @example
  1922. $ guix package --show=python@@3.4 | recsel -p name,version
  1923. name: python
  1924. version: 3.4.3
  1925. @end example
  1926. @item --list-installed[=@var{Regexp}]
  1927. @itemx -I [@var{Regexp}]
  1928. Listet die derzeit installierten Pakete im angegebenen Profil auf, die
  1929. zuletzt installierten Pakete zuletzt. Wenn ein regulärer Ausdruck
  1930. @var{Regexp} angegeben wird, werden nur installierte Pakete aufgeführt,
  1931. deren Name zu @var{Regexp} passt.
  1932. Zu jedem installierten Paket werden folgende Informationen angezeigt, durch
  1933. Tabulatorzeichen getrennt: der Paketname, die Version als Zeichenkette,
  1934. welche Teile des Pakets installiert sind (zum Beispiel @code{out}, wenn die
  1935. Standard-Paketausgabe installiert ist, @code{include}, wenn seine Header
  1936. installiert sind, usw.) und an welchem Pfad das Paket im Store zu finden
  1937. ist.
  1938. @item --list-available[=@var{Regexp}]
  1939. @itemx -A [@var{Regexp}]
  1940. Listet Pakete auf, die in der aktuell installierten Distribution dieses
  1941. Systems verfügbar sind (@pxref{GNU-Distribution}). Wenn ein regulärer
  1942. Ausdruck @var{Regexp} angegeben wird, werden nur Pakete aufgeführt, deren
  1943. Name zum regulären Ausdruck @var{Regexp} passt.
  1944. Zu jedem Paket werden folgende Informationen getrennt durch Tabulatorzeichen
  1945. ausgegeben: der Name, die Version als Zeichenkette, die Teile des Programms
  1946. (@pxref{Pakete mit mehreren Ausgaben.}) und die Stelle im Quellcode, an der
  1947. das Paket definiert ist.
  1948. @item --list-generations[=@var{Muster}]
  1949. @itemx -l [@var{Muster}]
  1950. @cindex Generationen
  1951. Liefert eine Liste der Generationen zusammen mit dem Datum, an dem sie
  1952. erzeugt wurden; zu jeder Generation werden zudem die installierten Pakete
  1953. angezeigt, zuletzt installierte Pakete zuletzt. Beachten Sie, dass die
  1954. nullte Generation niemals angezeigt wird.
  1955. Zu jedem installierten Paket werden folgende Informationen durch
  1956. Tabulatorzeichen getrennt angezeigt: der Name des Pakets, die Version als
  1957. Zeichenkette, welcher Teil des Pakets installiert ist (@pxref{Pakete mit mehreren Ausgaben.}) und an welcher Stelle sich das Paket im Store befindet.
  1958. Wenn ein @var{Muster} angegeben wird, liefert der Befehl nur dazu passende
  1959. Generationen. Gültige Muster sind zum Beispiel:
  1960. @itemize
  1961. @item @emph{Ganze Zahlen und kommagetrennte ganze Zahlen}. Beide Muster bezeichnen
  1962. Generationsnummern. Zum Beispiel liefert @code{--list-generations=1} die
  1963. erste Generation.
  1964. Durch @code{--list-generations=1,8,2} werden drei Generationen in der
  1965. angegebenen Reihenfolge angezeigt. Weder Leerzeichen noch ein Komma am
  1966. Schluss der Liste ist erlaubt.
  1967. @item @emph{Bereiche}. @code{--list-generations=2..9} gibt die
  1968. angegebenen Generationen und alles dazwischen aus. Beachten Sie, dass der
  1969. Bereichsanfang eine kleinere Zahl als das Bereichsende sein muss.
  1970. Sie können auch kein Bereichsende angeben, zum Beispiel liefert
  1971. @code{--list-generations=2..} alle Generationen ab der zweiten.
  1972. @item @emph{Zeitdauern}. Sie können auch die letzten @emph{N}@tie{}Tage, Wochen
  1973. or months by passing an integer along with the first letter of the
  1974. duration. For example, @code{--list-generations=20d} lists generations that
  1975. are up to 20 days old.
  1976. @end itemize
  1977. @item --delete-generations[=@var{Muster}]
  1978. @itemx -d [@var{Muster}]
  1979. Wird kein @var{Muster} angegeben, werden alle Generationen außer der
  1980. aktuellen entfernt.
  1981. Dieser Befehl akzeptiert dieselben Muster wie
  1982. @option{--list-generations}. Wenn ein @var{Muster} angegeben wird, werden
  1983. die passenden Generationen gelöscht. Wenn das @var{Muster} für eine
  1984. Zeitdauer steht, werden diejenigen Generationen gelöscht, die @emph{älter}
  1985. als die angegebene Dauer sind. Zum Beispiel löscht
  1986. @code{--delete-generations=1m} die Generationen, die mehr als einen Monat
  1987. alt sind.
  1988. Falls die aktuelle Generation zum Muster passt, wird sie @emph{nicht}
  1989. gelöscht. Auch die nullte Generation wird niemals gelöscht.
  1990. Beachten Sie, dass Sie auf gelöschte Generationen nicht zurückwechseln
  1991. können. Dieser Befehl sollte also nur mit Vorsicht benutzt werden.
  1992. @end table
  1993. Zu guter Letzt können Sie, da @command{guix package} Erstellungsprozesse zu
  1994. starten vermag, auch alle gemeinsamen Erstellungsoptionen (@pxref{Gemeinsame Erstellungsoptionen}) verwenden. Auch Paketumwandlungsoptionen wie
  1995. @option{--with-source} sind möglich (@pxref{Paketumwandlungsoptionen}). Beachten Sie jedoch, dass die verwendeten
  1996. Paketumwandlungsoptionen verloren gehen, nachdem Sie die Pakete aktualisiert
  1997. haben. Damit Paketumwandlungen über Aktualisierungen hinweg erhalten
  1998. bleiben, sollten Sie Ihre eigene Paketvariante in einem Guile-Modul
  1999. definieren und zur Umgebungsvariablen @code{GUIX_PACKAGE_PATH} hinzufügen
  2000. (@pxref{Pakete definieren}).
  2001. @node Substitute
  2002. @section Substitute
  2003. @cindex Substitute
  2004. @cindex vorerstellte Binärdateien
  2005. Guix kann transparent Binär- oder Quelldateien ausliefern. Das heißt, Dinge
  2006. können sowohl lokal erstellt, als auch als vorerstellte Objekte von einem
  2007. Server heruntergeladen werden, oder beides gemischt. Wir bezeichnen diese
  2008. vorerstellten Objekte als @dfn{Substitute} — sie substituieren lokale
  2009. Erstellungsergebnisse. In vielen Fällen geht das Herunterladen eines
  2010. Substituts wesentlich schneller, als Dinge lokal zu erstellen.
  2011. Substitute können alles sein, was das Ergebnis einer Ableitungserstellung
  2012. ist (@pxref{Ableitungen}). Natürlich sind sie üblicherweise vorerstellte
  2013. Paket-Binärdateien, aber wenn zum Beispiel ein Quell-Tarball das Ergebnis
  2014. einer Ableitungserstellung ist, kann auch er als Substitut verfügbar sein.
  2015. @menu
  2016. * Offizieller Substitut-Server:: Eine besondere Quelle von Substituten.
  2017. * Substitut-Server autorisieren:: Wie man Substitute an- und abschaltet.
  2018. * Substitutauthentifizierung:: Wie Guix Substitute verifiziert.
  2019. * Proxy-Einstellungen:: Wie Sie Substitute über einen Proxy beziehen.
  2020. * Fehler bei der Substitution:: Was passiert, wenn die Substitution
  2021. fehlschlägt.
  2022. * Vom Vertrauen gegenüber Binärdateien:: Wie können Sie diesem binären
  2023. Blob trauen?
  2024. @end menu
  2025. @node Offizieller Substitut-Server
  2026. @subsection Offizieller Substitut-Server
  2027. @cindex Hydra
  2028. @cindex Build-Farm
  2029. Der Server @code{mirror.hydra.gnu.org} ist die Façade für eine offizielle
  2030. »Build-Farm«, ein Erstellungswerk, das kontinuierlich Guix-Pakete für einige
  2031. Prozessorarchitekturen erstellt und sie als Substitute zur Verfügung
  2032. stellt. Dies ist die standardmäßige Quelle von Substituten; durch Übergeben
  2033. der Befehlszeilenoption @option{--substitute-urls} an entweder den
  2034. @command{guix-daemon} (@pxref{daemon-substitute-urls,, @code{guix-daemon
  2035. --substitute-urls}}) oder Client-Werkzeuge wie @command{guix package}
  2036. (@pxref{client-substitute-urls,, client @option{--substitute-urls} option})
  2037. kann eine abweichende Einstellung benutzt werden.
  2038. Substitut-URLs können entweder HTTP oder HTTPS sein. HTTPS wird empfohlen,
  2039. weil die Kommunikation verschlüsselt ist; umgekehrt kann bei HTTP die
  2040. Kommunikation belauscht werden, wodurch der Angreifer zum Beispiel erfahren
  2041. könnte, ob Ihr System über noch nicht behobene Sicherheitsschwachstellen
  2042. verfügt.
  2043. Substitute von der offiziellen Build-Farm sind standardmäßig erlaubt, wenn
  2044. Sie die Guix-System-Distribution verwenden (@pxref{GNU-Distribution}). Auf
  2045. Fremddistributionen sind sie allerdings standardmäßig ausgeschaltet, solange
  2046. Sie sie nicht ausdrücklich in einem der empfohlenen Installationsschritte
  2047. erlaubt haben (@pxref{Installation}). Die folgenden Absätze beschreiben, wie
  2048. Sie Substitute für die offizielle Build-Farm an- oder ausschalten; dieselbe
  2049. Prozedur kann auch benutzt werden, um Substitute für einen beliebigen
  2050. anderen Substitutsserver zu erlauben.
  2051. @node Substitut-Server autorisieren
  2052. @subsection Substitut-Server autorisieren
  2053. @cindex Sicherheit
  2054. @cindex Substitute, deren Autorisierung
  2055. @cindex Access Control List (ACL), für Substitute
  2056. @cindex ACL (Access Control List), für Substitute
  2057. Um es Guix zu gestatten, Substitute von @code{hydra.gnu.org} oder einem
  2058. Spiegelserver davon herunterzuladen, müssen Sie den zugehörigen öffentlichen
  2059. Schlüssel zur Access Control List (ACL, Zugriffssteuerungsliste) für
  2060. Archivimporte hinzufügen, mit Hilfe des Befehls @command{guix archive}
  2061. (@pxref{Aufruf von guix archive}). Dies impliziert, dass Sie darauf vertrauen,
  2062. dass @code{hydra.gnu.org} nicht kompromittiert wurde und echte Substitute
  2063. liefert.
  2064. Der öffentliche Schlüssel für @code{hydra.gnu.org} wird zusammen mit Guix
  2065. installiert, in das Verzeichnis
  2066. @code{@var{prefix}/share/guix/hydra.gnu.org.pub}, wobei @var{prefix} das
  2067. Installationspräfix von Guix ist. Wenn Sie Guix aus seinem Quellcode heraus
  2068. installieren, stellen Sie sicher, dass Sie die GPG-Signatur von
  2069. @file{guix-@value{VERSION}.tar.gz} prüfen, worin sich dieser öffentliche
  2070. Schlüssel befindet. Dann können Sie so etwas wie hier ausführen:
  2071. @example
  2072. # guix archive --authorize < @var{prefix}/share/guix/hydra.gnu.org.pub
  2073. @end example
  2074. @quotation Anmerkung
  2075. Genauso enthält die Datei @file{berlin.guixsd.org.pub} den öffentlichen
  2076. Schlüssel für die neue Build-Farm des Guix-Projekts, die unter
  2077. @indicateurl{https://berlin.guixsd.org} erreichbar ist.
  2078. Derzeit, als dieser Text geschrieben wurde, wird @code{berlin.guixsd.org}
  2079. ausgebaut, um besser skalieren zu können, aber Sie könnten es
  2080. ausprobieren. Dahinter stecken 20 x86_64-/i686-Erstellungsknoten, die
  2081. Substitute früher anbieten könnten als @code{mirror.hydra.gnu.org}.
  2082. @end quotation
  2083. Sobald es eingerichtet wurde, sollte sich die Ausgabe eines Befehls wie
  2084. @code{guix build} von so etwas:
  2085. @example
  2086. $ guix build emacs --dry-run
  2087. Folgende Ableitungen würden erstellt:
  2088. /gnu/store/yr7bnx8xwcayd6j95r2clmkdl1qh688w-emacs-24.3.drv
  2089. /gnu/store/x8qsh1hlhgjx6cwsjyvybnfv2i37z23w-dbus-1.6.4.tar.gz.drv
  2090. /gnu/store/1ixwp12fl950d15h2cj11c73733jay0z-alsa-lib-1.0.27.1.tar.bz2.drv
  2091. /gnu/store/nlma1pw0p603fpfiqy7kn4zm105r5dmw-util-linux-2.21.drv
  2092. @dots{}
  2093. @end example
  2094. @noindent
  2095. in so etwas verwandeln:
  2096. @example
  2097. $ guix build emacs --dry-run
  2098. 112.3 MB würden heruntergeladen:
  2099. /gnu/store/pk3n22lbq6ydamyymqkkz7i69wiwjiwi-emacs-24.3
  2100. /gnu/store/2ygn4ncnhrpr61rssa6z0d9x22si0va3-libjpeg-8d
  2101. /gnu/store/71yz6lgx4dazma9dwn2mcjxaah9w77jq-cairo-1.12.16
  2102. /gnu/store/7zdhgp0n1518lvfn8mb96sxqfmvqrl7v-libxrender-0.9.7
  2103. @dots{}
  2104. @end example
  2105. @noindent
  2106. Das zeigt an, dass Substitute von @code{hydra.gnu.org} nutzbar sind und für
  2107. zukünftige Erstellungen heruntergeladen werden, wann immer es möglich ist.
  2108. @cindex Substitute, wie man sie ausschaltet
  2109. Der Substitutsmechanismus kann global ausgeschaltet werden, indem Sie dem
  2110. @code{guix-daemon} beim Starten die Befehlszeilenoption
  2111. @code{--no-substitutes} übergeben (@pxref{Aufruf des guix-daemon}). Er kann
  2112. auch temporär ausgeschaltet werden, indem Sie @code{--no-substitutes} an
  2113. @command{guix package}, @command{guix build} und andere
  2114. Befehlszeilenwerkzeuge übergeben.
  2115. @node Substitutauthentifizierung
  2116. @subsection Substitutauthentifizierung
  2117. @cindex digitale Signaturen
  2118. Guix erkennt, wenn ein verfälschtes Substitut benutzt würde, und meldet
  2119. einen Fehler. Ebenso werden Substitute ignoriert, die nich signiert sind,
  2120. oder nicht mit einem in der ACL aufgelisteten Schlüssel signiert sind.
  2121. Es gibt nur eine Ausnahme: Wenn ein unautorisierter Server Substitute
  2122. anbietet, die @emph{Bit für Bit identisch} mit denen von einem autorisierten
  2123. Server sind, können sie auch vom unautorisierten Server heruntergeladen
  2124. werden. Zum Beispiel, angenommen wir haben zwei Substitutserver mit dieser
  2125. Befehlszeilenoption ausgewählt:
  2126. @example
  2127. --substitute-urls="https://a.example.org https://b.example.org"
  2128. @end example
  2129. @noindent
  2130. @cindex Reproduzierbare Erstellungen
  2131. Wenn in der ACL nur der Schlüssel für @code{b.example.org} aufgeführt wurde,
  2132. aber @code{a.example.org} @emph{exakt dieselben} Substitute anbietet, wird
  2133. Guix auch Substitute von @code{a.example.org} herunterladen, weil es in der
  2134. Liste zuerst kommt und als Spiegelserver für @code{b.example.org} aufgefasst
  2135. werden kann. In der Praxis haben unabhängige Maschinen bei der Erstellung
  2136. normalerweise dieselben Binärdateien als Ergebnis, dank bit-reproduzierbarer
  2137. Erstellungen (siehe unten).
  2138. Wenn Sie HTTPS benutzen, wird das X.509-Zertifikat des Servers @emph{nicht}
  2139. validiert (mit anderen Worten, die Identität des Servers wird nicht
  2140. authentifiziert), entgegen dem, was HTTPS-Clients wie Web-Browser
  2141. normalerweise tun. Da Guix Substitutinformationen selbst überprüft, wie oben
  2142. erklärt, wäre es unnötig (wohingegen mit X.509-Zertifikaten geprüft wird, ob
  2143. ein Domain-Name zu öffentlichen Schlüsseln passt).
  2144. @node Proxy-Einstellungen
  2145. @subsection Proxy-Einstellungen
  2146. @vindex http_proxy
  2147. Substitute werden über HTTP oder HTTPS heruntergeladen. Die
  2148. Umgebungsvariable @code{http_proxy} kann in der Umgebung von
  2149. @command{guix-daemon} definiert werden und wirkt sich dann auf das
  2150. Herunterladen von Substituten aus. Beachten Sie, dass der Wert von
  2151. @code{http_proxy} in der Umgebung, in der @command{guix build},
  2152. @command{guix package} und andere Client-Befehle ausgeführt werden,
  2153. @emph{keine Rolle spielt}.
  2154. @node Fehler bei der Substitution
  2155. @subsection Fehler bei der Substitution
  2156. Selbst wenn ein Substitut für eine Ableitung verfügbar ist, schlägt die
  2157. versuchte Substitution manchmal fehl. Das kann aus vielen Gründen geschehen:
  2158. die Substitutsserver könnten offline sein, das Substitut könnte kürzlich
  2159. gelöscht worden sein, die Netzwerkverbindunge könnte unterbrochen worden
  2160. sein, usw.
  2161. Wenn Substitute aktiviert sind und ein Substitut für eine Ableitung zwar
  2162. verfügbar ist, aber die versuchte Substitution fehlschlägt, kann Guix
  2163. versuchen, die Ableitung lokal zu erstellen, je nachdem, ob
  2164. @code{--fallback} übergeben wurde (@pxref{fallback-option,, common build
  2165. option @code{--fallback}}). Genauer gesagt, wird keine lokale Erstellung
  2166. durchgeführt, solange kein @code{--fallback} angegeben wurde, und die
  2167. Ableitung wird als Fehlschlag angesehen. Wenn @code{--fallback} übergeben
  2168. wurde, wird Guix versuchen, die Ableitung lokal zu erstellen, und ob die
  2169. Ableitung erfolgreich ist oder nicht, hängt davon ab, ob die lokale
  2170. Erstellung erfolgreich ist oder nicht. Beachten Sie, dass, falls Substitute
  2171. ausgeschaltet oder erst gar kein Substitut verfügbar ist, @emph{immer} eine
  2172. lokale Erstellung durchgeführt wird, egal ob @code{--fallback} übergeben
  2173. wurde oder nicht.
  2174. Um eine Vorstellung zu bekommen, wieviele Substitute gerade verfügbar sind,
  2175. können Sie den Befehl @command{guix weather} benutzen (@pxref{Aufruf von guix weather}). Dieser Befehl zeigt Statistiken darüber an, wie es um die von
  2176. einem Server verfügbaren Substitute steht.
  2177. @node Vom Vertrauen gegenüber Binärdateien
  2178. @subsection Vom Vertrauen gegenüber Binärdateien
  2179. @cindex Vertrauen, gegenüber vorerstellten Binärdateien
  2180. Derzeit hängt die Kontrolle jedes Individuums über seine Rechner von
  2181. Institutionen, Unternehmen und solchen Gruppierungen ab, die über genug
  2182. Macht und Entschlusskraft verfügen, die Rechnerinfrastruktur zu sabotieren
  2183. und ihre Schwachstellen auszunutzen. Auch wenn es bequem ist, Substitute von
  2184. @code{hydra.gnu.org} zu benutzen, ermuntern wir Nutzer, auch selbst
  2185. Erstellungen durchzuführen oder gar ihre eigene Build-Farm zu betreiben,
  2186. damit @code{hydra.gnu.org} ein weniger interessantes Ziel wird. Eine Art,
  2187. uns zu helfen, ist, die von Ihnen erstellte Software mit dem Befehl
  2188. @command{guix publish} zu veröffentlichen, damit andere eine größere Auswahl
  2189. haben, von welchem Server sie Substitute beziehen möchten (@pxref{Aufruf von guix publish}).
  2190. Guix hat die richtigen Grundlagen, um die Reproduzierbarkeit von
  2191. Erstellungen zu maximieren (@pxref{Funktionalitäten}). In den meisten Fällen sollten
  2192. unabhängige Erstellungen eines bestimmten Pakets zu bitweise identischen
  2193. Ergebnissen führen. Wir können also mit Hilfe einer vielschichtigen Menge an
  2194. unabhängigen Paketerstellungen die Integrität unseres Systems besser
  2195. gewährleisten. Der Befehl @command{guix challenge} hat das Ziel, Nutzern zu
  2196. ermöglichen, Substitutserver zu beurteilen, und Entwickler dabei zu
  2197. unterstützen, nichtdeterministische Paketerstellungen zu finden
  2198. (@pxref{Aufruf von guix challenge}). Ebenso ermöglicht es die
  2199. Befehlszeilenoption @option{--check} von @command{guix build}, dass Nutzer
  2200. bereits installierte Substitute auf Echtheit zu prüfen, indem sie lokal
  2201. nachgebaut werden (@pxref{build-check, @command{guix build --check}}).
  2202. In Zukunft wollen wir, dass Guix Binärdateien an und von Nutzern
  2203. peer-to-peer veröffentlichen kann. Wenn Sie mit uns dieses Projekt
  2204. diskuttieren möchten, kommen Sie auf unsere Mailing-Liste
  2205. @email{guix-devel@@gnu.org}.
  2206. @node Pakete mit mehreren Ausgaben.
  2207. @section Pakete mit mehreren Ausgaben.
  2208. @cindex mehrere Ausgaben, bei Paketen
  2209. @cindex Paketausgaben
  2210. @cindex Ausgaben
  2211. Oft haben in Guix definierte Pakete eine einzige @dfn{Ausgabe} — d.h. aus
  2212. dem Quellpaket entsteht genau ein Verzeichnis im Store. Wenn Sie
  2213. @command{guix package -i glibc} ausführen, wird die Standard-Paketausgabe
  2214. des GNU-libc-Pakets installiert; die Standardausgabe wird @code{out}
  2215. genannt, aber ihr Name kann weggelassen werden, wie sie an obigem Befehl
  2216. sehen. In diesem speziellen Fall enthält die Standard-Paketausgabe von
  2217. @code{glibc} alle C-Headerdateien, gemeinsamen Bibliotheken (»Shared
  2218. Libraries«), statische Bibliotheken (»Static Libraries«), Dokumentation für
  2219. Info sowie andere zusätzliche Dateien.
  2220. Manchmal ist es besser, die verschiedenen Arten von Dateien, die aus einem
  2221. einzelnen Quellpaket hervorgehen, in getrennte Ausgaben zu unterteilen. Zum
  2222. Beispiel installiert die GLib-C-Bibliothek (die von GTK+ und damit
  2223. zusammenhängenden Paketen benutzt wird) mehr als 20 MiB an HTML-Seiten mit
  2224. Referenzdokumentation. Um den Nutzern, die das nicht brauchen, Platz zu
  2225. sparen, wird die Dokumentation in einer separaten Ausgabe abgelegt, genannt
  2226. @code{doc}. Um also die Hauptausgabe von GLib zu installieren, zu der alles
  2227. außer der Dokumentation gehört, ist der Befehl:
  2228. @example
  2229. guix package -i glib
  2230. @end example
  2231. @cindex Dokumentation
  2232. Der Befehl, um die Dokumentation zu installieren, ist:
  2233. @example
  2234. guix package -i glib:doc
  2235. @end example
  2236. Manche Pakete installieren Programme mit unterschiedlich großem
  2237. »Abhängigkeiten-Fußabdruck«. Zum Beispiel installiert das Paket WordNet
  2238. sowohl Befehlszeilenwerkzeuge als auch grafische Benutzerschnittstellen
  2239. (GUIs). Erstere hängen nur von der C-Bibliothek ab, während Letztere auch
  2240. von Tcl/Tk und den zu Grunde liegenden X-Bibliotheken abhängen. Jedenfalls
  2241. belassen wir deshalb die Befehlszeilenwerkzeuge in der
  2242. Standard-Paketausgabe, während sich die GUIs in einer separaten Ausgabe
  2243. befinden. So können Benutzer, die die GUIs nicht brauchen, Platz sparen. Der
  2244. Befehl @command{guix size} kann dabei helfen, solche Situationen zu erkennen
  2245. (@pxref{Aufruf von guix size}). @command{guix graph} kann auch helfen
  2246. (@pxref{Aufruf von guix graph}).
  2247. In der GNU-Distribution gibt es viele solche Pakete mit mehreren
  2248. Ausgaben. Andere Konventionen für Ausgabenamen sind zum Beispiel @code{lib}
  2249. für Bibliotheken und eventuell auch ihre Header-Dateien,, @code{bin} für
  2250. eigenständige Programme und @code{debug} für Informationen zur
  2251. Fehlerbehandlung (@pxref{Dateien zur Fehlersuche installieren}). Die Ausgaben eines
  2252. Pakets stehen in der dritten Spalte der Anzeige von @command{guix package
  2253. --list-available} (@pxref{Aufruf von guix package}).
  2254. @node Aufruf von guix gc
  2255. @section @command{guix gc} aufrufen
  2256. @cindex Müllsammler
  2257. @cindex Plattenspeicher
  2258. Pakete, die zwar installiert sind, aber nicht benutzt werden, können vom
  2259. @dfn{Müllsammler} entfernt werden. Mit dem Befehl @command{guix gc} können
  2260. Benutzer den Müllsammler ausdrücklich aufrufen, um Speicher im Verzeichnis
  2261. @file{/gnu/store} freizugeben. Dies ist der @emph{einzige} Weg, Dateien aus
  2262. @file{/gnu/store} zu entfernen — das manuelle Entfernen von Dateien kann den
  2263. Store irreparabel beschädigen!
  2264. @cindex GC-Wurzeln
  2265. @cindex Müllsammlerwurzeln
  2266. Der Müllsammler kennt eine Reihe von @dfn{Wurzeln}: Jede Datei in
  2267. @file{/gnu/store}, die von einer Wurzel aus erreichbar ist, gilt als
  2268. @dfn{lebendig} und kann nicht entfernt werden; jede andere Datei gilt als
  2269. @dfn{tot} und ist ein Kandidat, gelöscht zu werden. Die Menge der
  2270. Müllsammlerwurzeln (kurz auch »GC-Wurzeln«, von englisch »Garbage
  2271. Collector«) umfasst Standard-Benutzerprofile; standardmäßig werden diese
  2272. Müllsammlerwurzeln durch symbolische Verknüpfungen in
  2273. @file{/var/guix/gcroots} dargestellt. Neue Müllsammlerwurzeln können zum
  2274. Beispiel mit @command{guix build --root} festgelegt werden (@pxref{Aufruf von guix build}).
  2275. Bevor Sie mit @code{guix gc --collect-garbage} Speicher freimachen, wollen
  2276. Sie vielleicht alte Generationen von Benutzerprofilen löschen, damit alte
  2277. Paketerstellungen von diesen Generationen entfernt werden können. Führen Sie
  2278. dazu @code{guix package --delete-generations} aus (@pxref{Aufruf von guix package}).
  2279. Unsere Empfehlung ist, dass Sie den Müllsammler regelmäßig laufen lassen und
  2280. wenn Sie wenig freien Speicherplatz zur Verfügung haben. Um zum Beispiel
  2281. sicherzustellen, dass Sie mindestens 5@tie{}GB auf Ihrer Platte zur
  2282. Verfügung haben, benutzen Sie einfach:
  2283. @example
  2284. guix gc -F 5G
  2285. @end example
  2286. Es ist völlig sicher, dafür eine nicht interaktive, regelmäßige
  2287. Auftragsausführung vorzugeben (@pxref{Geplante Auftragsausführung}, für eine
  2288. Erklärung, wie man das in GuixSD tun kann). @command{guix gc} ohne
  2289. Befehlszeilenargumente auszuführen, lässt so viel Müll wie möglich sammeln,
  2290. aber das ist oft nicht, was man will, denn so muss man unter Umständen
  2291. Software erneut erstellen oder erneut herunterladen, weil der Müllsammler
  2292. sie als »tot« ansieht, sie aber zur Erstellung anderer Software wieder
  2293. gebraucht wird — das trifft zum Beispiel auf die Compiler-Toolchain zu.
  2294. Der Befehl @command{guix gc} hat drei Arbeitsmodi: Er kann benutzt werden,
  2295. um als Müllsammler tote Dateien zu entfernen (das Standardverhalten), um
  2296. ganz bestimmte, angegebene Datein zu löschen (mit der Befehlszeilenoption
  2297. @code{--delete}), um Müllsammlerinformationen auszugeben oder
  2298. fortgeschrittenere Anfragen zu verarbeiten. Die
  2299. Müllsammler-Befehlszeilenoptionen sind wie folgt:
  2300. @table @code
  2301. @item --collect-garbage[=@var{Minimum}]
  2302. @itemx -C [@var{Minimum}]
  2303. Lässt Müll sammeln — z.B. nicht erreichbare Dateien in @file{/gnu/store} und
  2304. seinen Unterverzeichnissen. Wird keine andere Befehlszeilenoption angegeben,
  2305. wird standardmäßig diese durchgeführt.
  2306. Wenn ein @var{Minimum} angegeben wurde, hört der Müllsammler auf, sobald
  2307. @var{Minimum} Bytes gesammelt wurden. Das @var{Minimum} kann die Anzahl der
  2308. Bytes bezeichnen oder mit einer Einheit als Suffix versehen sein, wie etwa
  2309. @code{MiB} für Mebibytes und @code{GB} für Gigabytes (@pxref{Block size,
  2310. size specifications,, coreutils, GNU Coreutils}).
  2311. Wird kein @var{Minimum} angegeben, sammelt der Müllsammler allen Müll.
  2312. @item --free-space=@var{Menge}
  2313. @itemx -F @var{Menge}
  2314. Sammelt Müll, bis die angegebene @var{Menge} an freiem Speicher in
  2315. @file{/gnu/store} zur Verfügung steht, falls möglich; die @var{Menge} ist
  2316. eine Speichergröße wie @code{500MiB}, wie oben beschrieben.
  2317. Wenn die angegebene @var{Menge} oder mehr bereits in @file{/gnu/store} frei
  2318. verfügbar ist, passiert nichts.
  2319. @item --delete
  2320. @itemx -d
  2321. Versucht, alle als Argumente angegebenen Dateien oder Verzeichnisse im Store
  2322. zu löschen. Dies schlägt fehl, wenn manche der Dateien oder Verzeichnisse
  2323. nicht im Store oder noch immer lebendig sind.
  2324. @item --list-failures
  2325. Store-Objekte auflisten, die zwischengespeicherten Erstellungsfehlern
  2326. entsprechen.
  2327. Hierbei wird nichts ausgegeben, sofern der Daemon nicht mit
  2328. @option{--cache-failures} gestartet wurde (@pxref{Aufruf des guix-daemon,
  2329. @option{--cache-failures}}).
  2330. @item --clear-failures
  2331. Die angegebenen Store-Objekte aus dem Zwischenspeicher für fehlgeschlagene
  2332. Erstellungen entfernen.
  2333. Auch diese Option macht nur Sinn, wenn der Daemon mit
  2334. @option{--cache-failures} gestartet wurde. Andernfalls passiert nichts.
  2335. @item --list-dead
  2336. Zeigt die Liste toter Dateien und Verzeichnisse an, die sich noch im Store
  2337. befinden — das heißt, Dateien, die von keiner Wurzel mehr erreichbar sind.
  2338. @item --list-live
  2339. Zeige die Liste lebendiger Store-Dateien und -Verzeichnisse.
  2340. @end table
  2341. Außerdem können Referenzen unter bestehenden Store-Dateien gefunden werden:
  2342. @table @code
  2343. @item --references
  2344. @itemx --referrers
  2345. @cindex Paketabhängigkeiten
  2346. Listet die referenzierten bzw. sie referenzierenden Objekte der angegebenen
  2347. Store-Dateien auf.
  2348. @item --requisites
  2349. @itemx -R
  2350. @cindex Abschluss
  2351. Listet alle Voraussetzungen der als Argumente übergebenen Store-Dateien
  2352. auf. Voraussetzungen sind die Store-Dateien selbst, ihre Referenzen sowie
  2353. die Referenzen davon, rekursiv. Mit anderen Worten, die zurückgelieferte
  2354. Liste ist der @dfn{transitive Abschluss} dieser Store-Dateien.
  2355. Der Abschnitt @xref{Aufruf von guix size} erklärt ein Werkzeug, um den
  2356. Speicherbedarf des Abschlusses eines Elements zu ermitteln. Siehe
  2357. @xref{Aufruf von guix graph} für ein Werkzeug, um den Referenzgraphen zu
  2358. veranschaulichen.
  2359. @item --derivers
  2360. @cindex Ableitung
  2361. Liefert die Ableitung(en), die zu den angegebenen Store-Objekten führen
  2362. (@pxref{Ableitungen}).
  2363. Zum Beispiel liefert dieser Befehl:
  2364. @example
  2365. guix gc --derivers `guix package -I ^emacs$ | cut -f4`
  2366. @end example
  2367. @noindent
  2368. die @file{.drv}-Datei(en), die zum in Ihrem Profil installierten
  2369. @code{emacs}-Paket führen.
  2370. Beachten Sie, dass es auch sein kann, dass keine passenden
  2371. @file{.drv}-Dateien existieren, zum Beispiel wenn diese Dateien bereits dem
  2372. Müllsammler zum Opfer gefallen sind. Es kann auch passieren, dass es mehr
  2373. als eine passende @file{.drv} gibt, bei Ableitungen mit fester Ausgabe.
  2374. @end table
  2375. Zuletzt können Sie mit folgenden Befehlszeilenoptionen die Integrität des
  2376. Stores prüfen und den Plattenspeicherverbrauch im Zaum halten.
  2377. @table @option
  2378. @item --verify[=@var{Optionen}]
  2379. @cindex Integrität, des Stores
  2380. @cindex Integritätsprüfung
  2381. Die Integrität des Stores verifizieren
  2382. Standardmäßig wird sichergestellt, dass alle Store-Objekte, die in der
  2383. Datenbank des Daemons als gültig markiert wurden, auch tatsächlich in
  2384. @file{/gnu/store} existieren.
  2385. Wenn angegeben, müssen die @var{Optionen} eine kommagetrennte Liste aus
  2386. mindestens einem der Worte @code{contents} und @code{repair} sein.
  2387. Wenn Sie @option{--verify=contents} übergeben, berechnet der Daemon den Hash
  2388. des Inhalts jedes Store-Objekts und vergleicht ihn mit dem Hash in der
  2389. Datenbank. Sind die Hashes ungleich, wird eine Datenbeschädigung
  2390. gemeldet. Weil dabei @emph{alle Dateien im Store} durchlaufen werden, kann
  2391. der Befehl viel Zeit brauchen, besonders auf Systemen mit langsamer Platte.
  2392. @cindex Store, reparieren
  2393. @cindex Datenbeschädigung, Behebung
  2394. Mit @option{--verify=repair} oder @option{--verify=contents,repair} versucht
  2395. der Daemon, beschädigte Store-Objekte zu reparieren, indem er Substitute für
  2396. selbige herunterlädt (@pxref{Substitute}). Weil die Reparatur nicht atomar
  2397. und daher womöglich riskant ist, kann nur der Systemadministrator den Befehl
  2398. benutzen. Eine weniger aufwendige Alternative, wenn Sie wissen, welches
  2399. Objekt beschädigt ist, ist, @command{guix build --repair} zu benutzen
  2400. (@pxref{Aufruf von guix build}).
  2401. @item --optimize
  2402. @cindex Deduplizieren
  2403. Den Store durch Nutzung harter Verknüpfungen für identische Dateien
  2404. optimieren — mit anderen Worten wird der Store @dfn{dedupliziert}.
  2405. Der Daemon führt Deduplizierung automatisch nach jeder erfolgreichen
  2406. Erstellung und jedem Importieren eines Archivs durch, sofern er nicht mit
  2407. @code{--disable-deduplication} (@pxref{Aufruf des guix-daemon,
  2408. @code{--disable-deduplication}}) gestartet wurde. Diese Befehlszeilenoption
  2409. brauchen Sie also in erster Linie dann, wenn der Daemon zuvor mit
  2410. @code{--disable-deduplication} gestartet worden ist.
  2411. @end table
  2412. @node Aufruf von guix pull
  2413. @section @command{guix pull} aufrufen
  2414. @cindex Aktualisieren von Guix
  2415. @cindex Updaten von Guix
  2416. @cindex @command{guix pull}
  2417. @cindex pull
  2418. Packages are installed or upgraded to the latest version available in the
  2419. distribution currently available on your local machine. To update that
  2420. distribution, along with the Guix tools, you must run @command{guix pull}:
  2421. the command downloads the latest Guix source code and package descriptions,
  2422. and deploys it. Source code is downloaded from a @uref{https://git-scm.com,
  2423. Git} repository, by default the official GNU@tie{}Guix repository, though
  2424. this can be customized.
  2425. Danach wird @command{guix package} Pakete und ihre Versionen entsprechend
  2426. der gerade heruntergeladenen Kopie von Guix benutzen. Nicht nur das, auch
  2427. alle Guix-Befehle und Scheme-Module werden aus der neuesten Version von Guix
  2428. kommen. Neue @command{guix}-Unterbefehle, die durch die Aktualisierung
  2429. hinzugekommen sind, werden also auch verfügbar.
  2430. Any user can update their Guix copy using @command{guix pull}, and the
  2431. effect is limited to the user who run @command{guix pull}. For instance,
  2432. when user @code{root} runs @command{guix pull}, this has no effect on the
  2433. version of Guix that user @code{alice} sees, and vice versa.
  2434. The result of running @command{guix pull} is a @dfn{profile} available under
  2435. @file{~/.config/guix/current} containing the latest Guix. Thus, make sure
  2436. to add it to the beginning of your search path so that you use the latest
  2437. version, and similarly for the Info manual (@pxref{Dokumentation}):
  2438. @example
  2439. export PATH="$HOME/.config/guix/current/bin:$PATH"
  2440. export INFOPATH="$HOME/.config/guix/current/share/info:$INFOPATH"
  2441. @end example
  2442. The @code{--list-generations} or @code{-l} option lists past generations
  2443. produced by @command{guix pull}, along with details about their provenance:
  2444. @example
  2445. $ guix pull -l
  2446. Generation 1 Jun 10 2018 00:18:18
  2447. guix 65956ad
  2448. repository URL: https://git.savannah.gnu.org/git/guix.git
  2449. branch: origin/master
  2450. commit: 65956ad3526ba09e1f7a40722c96c6ef7c0936fe
  2451. Generation 2 Jun 11 2018 11:02:49
  2452. guix e0cc7f6
  2453. repository URL: https://git.savannah.gnu.org/git/guix.git
  2454. branch: origin/master
  2455. commit: e0cc7f669bec22c37481dd03a7941c7d11a64f1d
  2456. 2 new packages: keepalived, libnfnetlink
  2457. 6 packages upgraded: emacs-nix-mode@@2.0.4,
  2458. guile2.0-guix@@0.14.0-12.77a1aac, guix@@0.14.0-12.77a1aac,
  2459. heimdal@@7.5.0, milkytracker@@1.02.00, nix@@2.0.4
  2460. Generation 3 Jun 13 2018 23:31:07 (current)
  2461. guix 844cc1c
  2462. repository URL: https://git.savannah.gnu.org/git/guix.git
  2463. branch: origin/master
  2464. commit: 844cc1c8f394f03b404c5bb3aee086922373490c
  2465. 28 new packages: emacs-helm-ls-git, emacs-helm-mu, @dots{}
  2466. 69 packages upgraded: borg@@1.1.6, cheese@@3.28.0, @dots{}
  2467. @end example
  2468. @ref{Invoking guix describe, @command{guix describe}}, for other ways to
  2469. describe the current status of Guix.
  2470. This @code{~/.config/guix/current} profile works like any other profile
  2471. created by @command{guix package} (@pxref{Aufruf von guix package}). That is,
  2472. you can list generations, roll back to the previous generation---i.e., the
  2473. previous Guix---and so on:
  2474. @example
  2475. $ guix package -p ~/.config/guix/current --roll-back
  2476. switched from generation 3 to 2
  2477. $ guix package -p ~/.config/guix/current --delete-generations=1
  2478. deleting /var/guix/profiles/per-user/charlie/current-guix-1-link
  2479. @end example
  2480. Der Befehl @command{guix pull} wird in der Regel ohne Befehlszeilenargumente
  2481. aufgerufen, aber er versteht auch folgende Befehlszeilenoptionen:
  2482. @table @code
  2483. @item --url=@var{URL}
  2484. @itemx --commit=@var{Commit}
  2485. @itemx --branch=@var{Branch}
  2486. Download code from the specified @var{url}, at the given @var{commit} (a
  2487. valid Git commit ID represented as a hexadecimal string), or @var{branch}.
  2488. @cindex @file{channels.scm}, configuration file
  2489. @cindex configuration file for channels
  2490. These options are provided for convenience, but you can also specify your
  2491. configuration in the @file{~/.config/guix/channels.scm} file or using the
  2492. @option{--channels} option (see below).
  2493. @item --channels=@var{file}
  2494. @itemx -C @var{file}
  2495. Read the list of channels from @var{file} instead of
  2496. @file{~/.config/guix/channels.scm}. @var{file} must contain Scheme code
  2497. that evaluates to a list of channel objects. @xref{Channels}, for more
  2498. information.
  2499. @item --list-generations[=@var{Muster}]
  2500. @itemx -l [@var{Muster}]
  2501. List all the generations of @file{~/.config/guix/current} or, if
  2502. @var{pattern} is provided, the subset of generations that match
  2503. @var{pattern}. The syntax of @var{pattern} is the same as with @code{guix
  2504. package --list-generations} (@pxref{Aufruf von guix package}).
  2505. @ref{Invoking guix describe}, for a way to display information about the
  2506. current generation only.
  2507. @item --profile=@var{Profil}
  2508. @itemx -p @var{Profil}
  2509. Use @var{profile} instead of @file{~/.config/guix/current}.
  2510. @item --dry-run
  2511. @itemx -n
  2512. Show which channel commit(s) would be used and what would be built or
  2513. substituted but do not actually do it.
  2514. @item --verbose
  2515. Ausführliche Informationen ausgeben und Erstellungsprotokolle auf der
  2516. Standardfehlerausgabe ausgeben.
  2517. @item --bootstrap
  2518. Use the bootstrap Guile to build the latest Guix. This option is only
  2519. useful to Guix developers.
  2520. @end table
  2521. The @dfn{channel} mechanism allows you to instruct @command{guix pull} which
  2522. repository and branch to pull from, as well as @emph{additional}
  2523. repositories containing package modules that should be deployed.
  2524. @xref{Channels}, for more information.
  2525. In addition, @command{guix pull} supports all the common build options
  2526. (@pxref{Gemeinsame Erstellungsoptionen}).
  2527. @node Channels
  2528. @section Channels
  2529. @cindex channels
  2530. @cindex @file{channels.scm}, configuration file
  2531. @cindex configuration file for channels
  2532. @cindex @command{guix pull}, configuration file
  2533. @cindex configuration of @command{guix pull}
  2534. Guix and its package collection are updated by running @command{guix pull}
  2535. (@pxref{Aufruf von guix pull}). By default @command{guix pull} downloads and
  2536. deploys Guix itself from the official GNU@tie{}Guix repository. This can be
  2537. customized by defining @dfn{channels} in the
  2538. @file{~/.config/guix/channels.scm} file. A channel specifies a URL and
  2539. branch of a Git repository to be deployed, and @command{guix pull} can be
  2540. instructed to pull from one or more channels. In other words, channels can
  2541. be used to @emph{customize} and to @emph{extend} Guix, as we will see below.
  2542. @subsection Using a Custom Guix Channel
  2543. The channel called @code{guix} specifies where Guix itself---its
  2544. command-line tools as well as its package collection---should be
  2545. downloaded. For instance, suppose you want to update from your own copy of
  2546. the Guix repository at @code{example.org}, and specifically the
  2547. @code{super-hacks} branch, you can write in
  2548. @code{~/.config/guix/channels.scm} this specification:
  2549. @lisp
  2550. ;; Tell 'guix pull' to use my own repo.
  2551. (list (channel
  2552. (name 'guix)
  2553. (url "https://example.org/my-guix.git")
  2554. (branch "super-hacks")))
  2555. @end lisp
  2556. @noindent
  2557. From there on, @command{guix pull} will fetch code from the
  2558. @code{super-hacks} branch of the repository at @code{example.org}.
  2559. @subsection Specifying Additional Channels
  2560. @cindex extending the package collection (channels)
  2561. @cindex personal packages (channels)
  2562. @cindex channels, for personal packages
  2563. You can also specify @emph{additional channels} to pull from. Let's say you
  2564. have a bunch of custom package variants or personal packages that you think
  2565. would make little sense to contribute to the Guix project, but would like to
  2566. have these packages transparently available to you at the command line. You
  2567. would first write modules containing those package definitions
  2568. (@pxref{Paketmodule}), maintain them in a Git repository, and then you
  2569. and anyone else can use it as an additional channel to get packages from.
  2570. Neat, no?
  2571. @c What follows stems from discussions at
  2572. @c <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=22629#134> as well as
  2573. @c earlier discussions on guix-devel@gnu.org.
  2574. @quotation Warning
  2575. Before you, dear user, shout---``woow this is @emph{soooo coool}!''---and
  2576. publish your personal channel to the world, we would like to share a few
  2577. words of caution:
  2578. @itemize
  2579. @item
  2580. Before publishing a channel, please consider contributing your package
  2581. definitions to Guix proper (@pxref{Mitwirken}). Guix as a project is
  2582. open to free software of all sorts, and packages in Guix proper are readily
  2583. available to all Guix users and benefit from the project's quality assurance
  2584. process.
  2585. @item
  2586. When you maintain package definitions outside Guix, we, Guix developers,
  2587. consider that @emph{the compatibility burden is on you}. Remember that
  2588. package modules and package definitions are just Scheme code that uses
  2589. various programming interfaces (APIs). We want to remain free to change
  2590. these APIs to keep improving Guix, possibly in ways that break your
  2591. channel. We never change APIs gratuitously, but we will @emph{not} commit
  2592. to freezing APIs either.
  2593. @item
  2594. Corollary: if you're using an external channel and that channel breaks,
  2595. please @emph{report the issue to the channel authors}, not to the Guix
  2596. project.
  2597. @end itemize
  2598. You've been warned! Having said this, we believe external channels are a
  2599. practical way to exert your freedom to augment Guix' package collection and
  2600. to share your improvements, which are basic tenets of
  2601. @uref{https://www.gnu.org/philosophy/free-sw.html, free software}. Please
  2602. email us at @email{guix-devel@@gnu.org} if you'd like to discuss this.
  2603. @end quotation
  2604. Once you have a Git repository containing your own package modules, you can
  2605. write @code{~/.config/guix/channels.scm} to instruct @command{guix pull} to
  2606. pull from your personal channel @emph{in addition} to the default Guix
  2607. channel(s):
  2608. @vindex %default-channels
  2609. @lisp
  2610. ;; Add my personal packages to those Guix provides.
  2611. (cons (channel
  2612. (name 'my-personal-packages)
  2613. (url "https://example.org/personal-packages.git"))
  2614. %default-channels)
  2615. @end lisp
  2616. @noindent
  2617. Note that the snippet above is (as always!)@: Scheme code; we use
  2618. @code{cons} to add a channel the list of channels that the variable
  2619. @code{%default-channels} is bound to (@pxref{Pairs, @code{cons} and lists,,
  2620. guile, GNU Guile Reference Manual}). With this file in place, @command{guix
  2621. pull} builds not only Guix but also the package modules from your own
  2622. repository. The result in @file{~/.config/guix/current} is the union of
  2623. Guix with your own package modules:
  2624. @example
  2625. $ guix pull --list-generations
  2626. @dots{}
  2627. Generation 19 Aug 27 2018 16:20:48
  2628. guix d894ab8
  2629. repository URL: https://git.savannah.gnu.org/git/guix.git
  2630. branch: master
  2631. commit: d894ab8e9bfabcefa6c49d9ba2e834dd5a73a300
  2632. my-personal-packages dd3df5e
  2633. repository URL: https://example.org/personal-packages.git
  2634. branch: master
  2635. commit: dd3df5e2c8818760a8fc0bd699e55d3b69fef2bb
  2636. 11 new packages: my-gimp, my-emacs-with-cool-features, @dots{}
  2637. 4 packages upgraded: emacs-racket-mode@@0.0.2-2.1b78827, @dots{}
  2638. @end example
  2639. @noindent
  2640. The output of @command{guix pull} above shows that Generation@tie{}19
  2641. includes both Guix and packages from the @code{my-personal-packages}
  2642. channel. Among the new and upgraded packages that are listed, some like
  2643. @code{my-gimp} and @code{my-emacs-with-cool-features} might come from
  2644. @code{my-personal-packages}, while others come from the Guix default
  2645. channel.
  2646. @subsection Replicating Guix
  2647. @cindex pinning, channels
  2648. @cindex replicating Guix
  2649. @cindex reproducibility, of Guix
  2650. The @command{guix pull --list-generations} output above shows precisely
  2651. which commits were used to build this instance of Guix. We can thus
  2652. replicate it, say, on another machine, by providing a channel specification
  2653. in @file{~/.config/guix/channels.scm} that is ``pinned'' to these commits:
  2654. @lisp
  2655. ;; Deploy specific commits of my channels of interest.
  2656. (list (channel
  2657. (name 'guix)
  2658. (url "https://git.savannah.gnu.org/git/guix.git")
  2659. (commit "d894ab8e9bfabcefa6c49d9ba2e834dd5a73a300"))
  2660. (channel
  2661. (name 'my-personal-packages)
  2662. (url "https://example.org/personal-packages.git")
  2663. (branch "dd3df5e2c8818760a8fc0bd699e55d3b69fef2bb")))
  2664. @end lisp
  2665. The @command{guix describe --format=channels} command can even generate this
  2666. list of channels directly (@pxref{Invoking guix describe}).
  2667. At this point the two machines run the @emph{exact same Guix}, with access
  2668. to the @emph{exact same packages}. The output of @command{guix build gimp}
  2669. on one machine will be exactly the same, bit for bit, as the output of the
  2670. same command on the other machine. It also means both machines have access
  2671. to all the source code of Guix and, transitively, to all the source code of
  2672. every package it defines.
  2673. This gives you super powers, allowing you to track the provenance of binary
  2674. artifacts with very fine grain, and to reproduce software environments at
  2675. will---some sort of ``meta reproducibility'' capabilities, if you will.
  2676. @xref{Inferiors}, for another way to take advantage of these super powers.
  2677. @node Inferiors
  2678. @section Inferiors
  2679. @c TODO: Remove this once we're more confident about API stability.
  2680. @quotation Anmerkung
  2681. The functionality described here is a ``technology preview'' as of version
  2682. @value{VERSION}. As such, the interface is subject to change.
  2683. @end quotation
  2684. @cindex inferiors
  2685. @cindex composition of Guix revisions
  2686. Sometimes you might need to mix packages from the revision of Guix you're
  2687. currently running with packages available in a different revision of Guix.
  2688. Guix @dfn{inferiors} allow you to achieve that by composing different Guix
  2689. revisions in arbitrary ways.
  2690. @cindex inferior packages
  2691. Technically, an ``inferior'' is essentially a separate Guix process
  2692. connected to your main Guix process through a REPL (@pxref{Invoking guix
  2693. repl}). The @code{(guix inferior)} module allows you to create inferiors
  2694. and to communicate with them. It also provides a high-level interface to
  2695. browse and manipulate the packages that an inferior provides---@dfn{inferior
  2696. packages}.
  2697. When combined with channels (@pxref{Channels}), inferiors provide a simple
  2698. way to interact with a separate revision of Guix. For example, let's assume
  2699. you want to install in your profile the current @code{guile} package, along
  2700. with the @code{guile-json} as it existed in an older revision of
  2701. Guix---perhaps because the newer @code{guile-json} has an incompatible API
  2702. and you want to run your code against the old API@. To do that, you could
  2703. write a manifest for use by @code{guix package --manifest} (@pxref{Aufruf von guix package}); in that manifest, you would create an inferior for that old
  2704. Guix revision you care about, and you would look up the @code{guile-json}
  2705. package in the inferior:
  2706. @lisp
  2707. (use-modules (guix inferior) (guix channels)
  2708. (srfi srfi-1)) ;for 'first'
  2709. (define channels
  2710. ;; This is the old revision from which we want to
  2711. ;; extract guile-json.
  2712. (list (channel
  2713. (name 'guix)
  2714. (url "https://git.savannah.gnu.org/git/guix.git")
  2715. (commit
  2716. "65956ad3526ba09e1f7a40722c96c6ef7c0936fe"))))
  2717. (define inferior
  2718. ;; An inferior representing the above revision.
  2719. (inferior-for-channels channels))
  2720. ;; Now create a manifest with the current "guile" package
  2721. ;; and the old "guile-json" package.
  2722. (packages->manifest
  2723. (list (first (lookup-inferior-packages inferior "guile-json"))
  2724. (specification->package "guile")))
  2725. @end lisp
  2726. On its first run, @command{guix package --manifest} might have to build the
  2727. channel you specified before it can create the inferior; subsequent runs
  2728. will be much faster because the Guix revision will be cached.
  2729. The @code{(guix inferior)} module provides the following procedures to open
  2730. an inferior:
  2731. @deffn {Scheme Procedure} inferior-for-channels @var{channels} @
  2732. [#:cache-directory] [#:ttl] Return an inferior for @var{channels}, a list of
  2733. channels. Use the cache at @var{cache-directory}, where entries can be
  2734. reclaimed after @var{ttl} seconds. This procedure opens a new connection to
  2735. the build daemon.
  2736. As a side effect, this procedure may build or substitute binaries for
  2737. @var{channels}, which can take time.
  2738. @end deffn
  2739. @deffn {Scheme Procedure} open-inferior @var{directory} @
  2740. [#:command "bin/guix"] Open the inferior Guix in @var{directory}, running
  2741. @code{@var{directory}/@var{command} repl} or equivalent. Return @code{#f}
  2742. if the inferior could not be launched.
  2743. @end deffn
  2744. @cindex inferior packages
  2745. The procedures listed below allow you to obtain and manipulate inferior
  2746. packages.
  2747. @deffn {Scheme Procedure} inferior-packages @var{inferior}
  2748. Return the list of packages known to @var{inferior}.
  2749. @end deffn
  2750. @deffn {Scheme Procedure} lookup-inferior-packages @var{inferior} @var{name} @
  2751. [@var{version}] Return the sorted list of inferior packages matching
  2752. @var{name} in @var{inferior}, with highest version numbers first. If
  2753. @var{version} is true, return only packages with a version number prefixed
  2754. by @var{version}.
  2755. @end deffn
  2756. @deffn {Scheme Procedure} inferior-package? @var{obj}
  2757. Return true if @var{obj} is an inferior package.
  2758. @end deffn
  2759. @deffn {Scheme Procedure} inferior-package-name @var{package}
  2760. @deffnx {Scheme Procedure} inferior-package-version @var{package}
  2761. @deffnx {Scheme Procedure} inferior-package-synopsis @var{package}
  2762. @deffnx {Scheme Procedure} inferior-package-description @var{package}
  2763. @deffnx {Scheme Procedure} inferior-package-home-page @var{package}
  2764. @deffnx {Scheme Procedure} inferior-package-location @var{package}
  2765. @deffnx {Scheme Procedure} inferior-package-inputs @var{package}
  2766. @deffnx {Scheme Procedure} inferior-package-native-inputs @var{package}
  2767. @deffnx {Scheme Procedure} inferior-package-propagated-inputs @var{package}
  2768. @deffnx {Scheme Procedure} inferior-package-transitive-propagated-inputs @var{package}
  2769. @deffnx {Scheme Procedure} inferior-package-native-search-paths @var{package}
  2770. @deffnx {Scheme Procedure} inferior-package-transitive-native-search-paths @var{package}
  2771. @deffnx {Scheme Procedure} inferior-package-search-paths @var{package}
  2772. These procedures are the counterpart of package record accessors
  2773. (@pxref{„package“-Referenz}). Most of them work by querying the inferior
  2774. @var{package} comes from, so the inferior must still be live when you call
  2775. these procedures.
  2776. @end deffn
  2777. Inferior packages can be used transparently like any other package or
  2778. file-like object in G-expressions (@pxref{G-Ausdrücke}). They are also
  2779. transparently handled by the @code{packages->manifest} procedure, which is
  2780. commonly use in manifests (@pxref{Aufruf von guix package, the
  2781. @option{--manifest} option of @command{guix package}}). Thus you can insert
  2782. an inferior package pretty much anywhere you would insert a regular package:
  2783. in manifests, in the @code{packages} field of your @code{operating-system}
  2784. declaration, and so on.
  2785. @node Invoking guix describe
  2786. @section Invoking @command{guix describe}
  2787. @cindex Reproduzierbarkeit
  2788. @cindex replicating Guix
  2789. Often you may want to answer questions like: ``Which revision of Guix am I
  2790. using?'' or ``Which channels am I using?'' This is useful information in
  2791. many situations: if you want to @emph{replicate} an environment on a
  2792. different machine or user account, if you want to report a bug or to
  2793. determine what change in the channels you are using caused it, or if you
  2794. want to record your system state for reproducibility purposes. The
  2795. @command{guix describe} command answers these questions.
  2796. When run from a @command{guix pull}ed @command{guix}, @command{guix
  2797. describe} displays the channel(s) that it was built from, including their
  2798. repository URL and commit IDs (@pxref{Channels}):
  2799. @example
  2800. $ guix describe
  2801. Generation 10 Sep 03 2018 17:32:44 (current)
  2802. guix e0fa68c
  2803. repository URL: https://git.savannah.gnu.org/git/guix.git
  2804. branch: master
  2805. commit: e0fa68c7718fffd33d81af415279d6ddb518f727
  2806. @end example
  2807. If you're familiar with the Git version control system, this is similar in
  2808. spirit to @command{git describe}; the output is also similar to that of
  2809. @command{guix pull --list-generations}, but limited to the current
  2810. generation (@pxref{Aufruf von guix pull, the @option{--list-generations}
  2811. option}). Because the Git commit ID shown above unambiguously refers to a
  2812. snapshot of Guix, this information is all it takes to describe the revision
  2813. of Guix you're using, and also to replicate it.
  2814. To make it easier to replicate Guix, @command{guix describe} can also be
  2815. asked to return a list of channels instead of the human-readable description
  2816. above:
  2817. @example
  2818. $ guix describe -f channels
  2819. (list (channel
  2820. (name 'guix)
  2821. (url "https://git.savannah.gnu.org/git/guix.git")
  2822. (commit
  2823. "e0fa68c7718fffd33d81af415279d6ddb518f727")))
  2824. @end example
  2825. @noindent
  2826. You can save this to a file and feed it to @command{guix pull -C} on some
  2827. other machine or at a later point in time, which will instantiate @emph{this
  2828. exact Guix revision} (@pxref{Aufruf von guix pull, the @option{-C} option}).
  2829. From there on, since you're able to deploy the same revision of Guix, you
  2830. can just as well @emph{replicate a complete software environment}. We
  2831. humbly think that this is @emph{awesome}, and we hope you'll like it too!
  2832. The details of the options supported by @command{guix describe} are as
  2833. follows:
  2834. @table @code
  2835. @item --format=@var{format}
  2836. @itemx -f @var{format}
  2837. Produce output in the specified @var{format}, one of:
  2838. @table @code
  2839. @item human
  2840. produce human-readable output;
  2841. @item channels
  2842. produce a list of channel specifications that can be passed to @command{guix
  2843. pull -C} or installed as @file{~/.config/guix/channels.scm} (@pxref{Aufruf von guix pull});
  2844. @item json
  2845. @cindex JSON
  2846. produce a list of channel specifications in JSON format;
  2847. @item recutils
  2848. produce a list of channel specifications in Recutils format.
  2849. @end table
  2850. @item --profile=@var{Profil}
  2851. @itemx -p @var{Profil}
  2852. Display information about @var{profile}.
  2853. @end table
  2854. @node Aufruf von guix pack
  2855. @section Invoking @command{guix pack}
  2856. Occasionally you want to pass software to people who are not (yet!) lucky
  2857. enough to be using Guix. You'd tell them to run @command{guix package -i
  2858. @var{something}}, but that's not possible in this case. This is where
  2859. @command{guix pack} comes in.
  2860. @quotation Anmerkung
  2861. If you are looking for ways to exchange binaries among machines that already
  2862. run Guix, @pxref{Aufruf von guix copy}, @ref{Aufruf von guix publish}, and
  2863. @ref{Aufruf von guix archive}.
  2864. @end quotation
  2865. @cindex pack
  2866. @cindex bundle
  2867. @cindex application bundle
  2868. @cindex software bundle
  2869. The @command{guix pack} command creates a shrink-wrapped @dfn{pack} or
  2870. @dfn{software bundle}: it creates a tarball or some other archive containing
  2871. the binaries of the software you're interested in, and all its
  2872. dependencies. The resulting archive can be used on any machine that does
  2873. not have Guix, and people can run the exact same binaries as those you have
  2874. with Guix. The pack itself is created in a bit-reproducible fashion, so
  2875. anyone can verify that it really contains the build results that you pretend
  2876. to be shipping.
  2877. For example, to create a bundle containing Guile, Emacs, Geiser, and all
  2878. their dependencies, you can run:
  2879. @example
  2880. $ guix pack guile emacs geiser
  2881. @dots{}
  2882. /gnu/store/@dots{}-pack.tar.gz
  2883. @end example
  2884. The result here is a tarball containing a @file{/gnu/store} directory with
  2885. all the relevant packages. The resulting tarball contains a @dfn{profile}
  2886. with the three packages of interest; the profile is the same as would be
  2887. created by @command{guix package -i}. It is this mechanism that is used to
  2888. create Guix's own standalone binary tarball (@pxref{Aus Binärdatei installieren}).
  2889. Users of this pack would have to run
  2890. @file{/gnu/store/@dots{}-profile/bin/guile} to run Guile, which you may find
  2891. inconvenient. To work around it, you can create, say, a @file{/opt/gnu/bin}
  2892. symlink to the profile:
  2893. @example
  2894. guix pack -S /opt/gnu/bin=bin guile emacs geiser
  2895. @end example
  2896. @noindent
  2897. That way, users can happily type @file{/opt/gnu/bin/guile} and enjoy.
  2898. @cindex relocatable binaries, with @command{guix pack}
  2899. What if the recipient of your pack does not have root privileges on their
  2900. machine, and thus cannot unpack it in the root file system? In that case,
  2901. you will want to use the @code{--relocatable} option (see below). This
  2902. option produces @dfn{relocatable binaries}, meaning they they can be placed
  2903. anywhere in the file system hierarchy: in the example above, users can
  2904. unpack your tarball in their home directory and directly run
  2905. @file{./opt/gnu/bin/guile}.
  2906. @cindex Docker, build an image with guix pack
  2907. Alternatively, you can produce a pack in the Docker image format using the
  2908. following command:
  2909. @example
  2910. guix pack -f docker guile emacs geiser
  2911. @end example
  2912. @noindent
  2913. The result is a tarball that can be passed to the @command{docker load}
  2914. command. See the
  2915. @uref{https://docs.docker.com/engine/reference/commandline/load/, Docker
  2916. documentation} for more information.
  2917. @cindex Singularity, build an image with guix pack
  2918. @cindex SquashFS, build an image with guix pack
  2919. Yet another option is to produce a SquashFS image with the following
  2920. command:
  2921. @example
  2922. guix pack -f squashfs guile emacs geiser
  2923. @end example
  2924. @noindent
  2925. The result is a SquashFS file system image that can either be mounted or
  2926. directly be used as a file system container image with the
  2927. @uref{http://singularity.lbl.gov, Singularity container execution
  2928. environment}, using commands like @command{singularity shell} or
  2929. @command{singularity exec}.
  2930. Several command-line options allow you to customize your pack:
  2931. @table @code
  2932. @item --format=@var{format}
  2933. @itemx -f @var{format}
  2934. Produce a pack in the given @var{format}.
  2935. The available formats are:
  2936. @table @code
  2937. @item tarball
  2938. This is the default format. It produces a tarball containing all the
  2939. specified binaries and symlinks.
  2940. @item docker
  2941. This produces a tarball that follows the
  2942. @uref{https://github.com/docker/docker/blob/master/image/spec/v1.2.md,
  2943. Docker Image Specification}.
  2944. @item squashfs
  2945. This produces a SquashFS image containing all the specified binaries and
  2946. symlinks, as well as empty mount points for virtual file systems like
  2947. procfs.
  2948. @end table
  2949. @item --relocatable
  2950. @itemx -R
  2951. Produce @dfn{relocatable binaries}---i.e., binaries that can be placed
  2952. anywhere in the file system hierarchy and run from there. For example, if
  2953. you create a pack containing Bash with:
  2954. @example
  2955. guix pack -R -S /mybin=bin bash
  2956. @end example
  2957. @noindent
  2958. ...@: you can copy that pack to a machine that lacks Guix, and from your
  2959. home directory as a normal user, run:
  2960. @example
  2961. tar xf pack.tar.gz
  2962. ./mybin/sh
  2963. @end example
  2964. @noindent
  2965. In that shell, if you type @code{ls /gnu/store}, you'll notice that
  2966. @file{/gnu/store} shows up and contains all the dependencies of @code{bash},
  2967. even though the machine actually lacks @file{/gnu/store} altogether! That is
  2968. probably the simplest way to deploy Guix-built software on a non-Guix
  2969. machine.
  2970. There's a gotcha though: this technique relies on the @dfn{user namespace}
  2971. feature of the kernel Linux, which allows unprivileged users to mount or
  2972. change root. Old versions of Linux did not support it, and some GNU/Linux
  2973. distributions turn it off; on these systems, programs from the pack
  2974. @emph{will fail to run}, unless they are unpacked in the root file system.
  2975. @item --expression=@var{expr}
  2976. @itemx -e @var{expr}
  2977. Consider the package @var{expr} evaluates to.
  2978. This has the same purpose as the same-named option in @command{guix build}
  2979. (@pxref{Zusätzliche Erstellungsoptionen, @code{--expression} in @command{guix
  2980. build}}).
  2981. @item --manifest=@var{Datei}
  2982. @itemx -m @var{Datei}
  2983. Use the packages contained in the manifest object returned by the Scheme
  2984. code in @var{file}.
  2985. This has a similar purpose as the same-named option in @command{guix
  2986. package} (@pxref{profile-manifest, @option{--manifest}}) and uses the same
  2987. manifest files. It allows you to define a collection of packages once and
  2988. use it both for creating profiles and for creating archives for use on
  2989. machines that do not have Guix installed. Note that you can specify
  2990. @emph{either} a manifest file @emph{or} a list of packages, but not both.
  2991. @item --system=@var{System}
  2992. @itemx -s @var{system}
  2993. Attempt to build for @var{system}---e.g., @code{i686-linux}---instead of the
  2994. system type of the build host.
  2995. @item --target=@var{triplet}
  2996. @cindex cross-compilation
  2997. Cross-build for @var{triplet}, which must be a valid GNU triplet, such as
  2998. @code{"mips64el-linux-gnu"} (@pxref{Specifying target triplets, GNU
  2999. configuration triplets,, autoconf, Autoconf}).
  3000. @item --compression=@var{tool}
  3001. @itemx -C @var{tool}
  3002. Compress the resulting tarball using @var{tool}---one of @code{gzip},
  3003. @code{bzip2}, @code{xz}, @code{lzip}, or @code{none} for no compression.
  3004. @item --symlink=@var{spec}
  3005. @itemx -S @var{spec}
  3006. Add the symlinks specified by @var{spec} to the pack. This option can
  3007. appear several times.
  3008. @var{spec} has the form @code{@var{source}=@var{target}}, where @var{source}
  3009. is the symlink that will be created and @var{target} is the symlink target.
  3010. For instance, @code{-S /opt/gnu/bin=bin} creates a @file{/opt/gnu/bin}
  3011. symlink pointing to the @file{bin} sub-directory of the profile.
  3012. @item --localstatedir
  3013. @itemx --profile-name=@var{name}
  3014. Include the ``local state directory'', @file{/var/guix}, in the resulting
  3015. pack, and notably the @file{/var/guix/profiles/per-user/root/@var{name}}
  3016. profile---by default @var{name} is @code{guix-profile}, which corresponds to
  3017. @file{~root/.guix-profile}.
  3018. @file{/var/guix} contains the store database (@pxref{Der Store}) as well as
  3019. garbage-collector roots (@pxref{Aufruf von guix gc}). Providing it in the
  3020. pack means that the store is ``complete'' and manageable by Guix; not
  3021. providing it pack means that the store is ``dead'': items cannot be added to
  3022. it or removed from it after extraction of the pack.
  3023. One use case for this is the Guix self-contained binary tarball
  3024. (@pxref{Aus Binärdatei installieren}).
  3025. @item --bootstrap
  3026. Use the bootstrap binaries to build the pack. This option is only useful to
  3027. Guix developers.
  3028. @end table
  3029. In addition, @command{guix pack} supports all the common build options
  3030. (@pxref{Gemeinsame Erstellungsoptionen}) and all the package transformation options
  3031. (@pxref{Paketumwandlungsoptionen}).
  3032. @node Aufruf von guix archive
  3033. @section Invoking @command{guix archive}
  3034. @cindex @command{guix archive}
  3035. @cindex archive
  3036. The @command{guix archive} command allows users to @dfn{export} files from
  3037. the store into a single archive, and to later @dfn{import} them on a machine
  3038. that runs Guix. In particular, it allows store files to be transferred from
  3039. one machine to the store on another machine.
  3040. @quotation Anmerkung
  3041. If you're looking for a way to produce archives in a format suitable for
  3042. tools other than Guix, @pxref{Aufruf von guix pack}.
  3043. @end quotation
  3044. @cindex exporting store items
  3045. To export store files as an archive to standard output, run:
  3046. @example
  3047. guix archive --export @var{options} @var{specifications}...
  3048. @end example
  3049. @var{specifications} may be either store file names or package
  3050. specifications, as for @command{guix package} (@pxref{Aufruf von guix package}). For instance, the following command creates an archive
  3051. containing the @code{gui} output of the @code{git} package and the main
  3052. output of @code{emacs}:
  3053. @example
  3054. guix archive --export git:gui /gnu/store/...-emacs-24.3 > great.nar
  3055. @end example
  3056. If the specified packages are not built yet, @command{guix archive}
  3057. automatically builds them. The build process may be controlled with the
  3058. common build options (@pxref{Gemeinsame Erstellungsoptionen}).
  3059. To transfer the @code{emacs} package to a machine connected over SSH, one
  3060. would run:
  3061. @example
  3062. guix archive --export -r emacs | ssh the-machine guix archive --import
  3063. @end example
  3064. @noindent
  3065. Similarly, a complete user profile may be transferred from one machine to
  3066. another like this:
  3067. @example
  3068. guix archive --export -r $(readlink -f ~/.guix-profile) | \
  3069. ssh the-machine guix-archive --import
  3070. @end example
  3071. @noindent
  3072. However, note that, in both examples, all of @code{emacs} and the profile as
  3073. well as all of their dependencies are transferred (due to @code{-r}),
  3074. regardless of what is already available in the store on the target machine.
  3075. The @code{--missing} option can help figure out which items are missing from
  3076. the target store. The @command{guix copy} command simplifies and optimizes
  3077. this whole process, so this is probably what you should use in this case
  3078. (@pxref{Aufruf von guix copy}).
  3079. @cindex nar, archive format
  3080. @cindex normalized archive (nar)
  3081. Archives are stored in the ``normalized archive'' or ``nar'' format, which
  3082. is comparable in spirit to `tar', but with differences that make it more
  3083. appropriate for our purposes. First, rather than recording all Unix
  3084. metadata for each file, the nar format only mentions the file type (regular,
  3085. directory, or symbolic link); Unix permissions and owner/group are
  3086. dismissed. Second, the order in which directory entries are stored always
  3087. follows the order of file names according to the C locale collation order.
  3088. This makes archive production fully deterministic.
  3089. @c FIXME: Add xref to daemon doc about signatures.
  3090. When exporting, the daemon digitally signs the contents of the archive, and
  3091. that digital signature is appended. When importing, the daemon verifies the
  3092. signature and rejects the import in case of an invalid signature or if the
  3093. signing key is not authorized.
  3094. The main options are:
  3095. @table @code
  3096. @item --export
  3097. Export the specified store files or packages (see below.) Write the
  3098. resulting archive to the standard output.
  3099. Dependencies are @emph{not} included in the output, unless
  3100. @code{--recursive} is passed.
  3101. @item -r
  3102. @itemx --recursive
  3103. When combined with @code{--export}, this instructs @command{guix archive} to
  3104. include dependencies of the given items in the archive. Thus, the resulting
  3105. archive is self-contained: it contains the closure of the exported store
  3106. items.
  3107. @item --import
  3108. Read an archive from the standard input, and import the files listed therein
  3109. into the store. Abort if the archive has an invalid digital signature, or
  3110. if it is signed by a public key not among the authorized keys (see
  3111. @code{--authorize} below.)
  3112. @item --missing
  3113. Read a list of store file names from the standard input, one per line, and
  3114. write on the standard output the subset of these files missing from the
  3115. store.
  3116. @item --generate-key[=@var{parameters}]
  3117. @cindex signing, archives
  3118. Generate a new key pair for the daemon. This is a prerequisite before
  3119. archives can be exported with @code{--export}. Note that this operation
  3120. usually takes time, because it needs to gather enough entropy to generate
  3121. the key pair.
  3122. The generated key pair is typically stored under @file{/etc/guix}, in
  3123. @file{signing-key.pub} (public key) and @file{signing-key.sec} (private key,
  3124. which must be kept secret.) When @var{parameters} is omitted, an ECDSA key
  3125. using the Ed25519 curve is generated, or, for Libgcrypt versions before
  3126. 1.6.0, it is a 4096-bit RSA key. Alternatively, @var{parameters} can
  3127. specify @code{genkey} parameters suitable for Libgcrypt (@pxref{General
  3128. public-key related Functions, @code{gcry_pk_genkey},, gcrypt, The Libgcrypt
  3129. Reference Manual}).
  3130. @item --authorize
  3131. @cindex authorizing, archives
  3132. Authorize imports signed by the public key passed on standard input. The
  3133. public key must be in ``s-expression advanced format''---i.e., the same
  3134. format as the @file{signing-key.pub} file.
  3135. The list of authorized keys is kept in the human-editable file
  3136. @file{/etc/guix/acl}. The file contains
  3137. @url{http://people.csail.mit.edu/rivest/Sexp.txt, ``advanced-format
  3138. s-expressions''} and is structured as an access-control list in the
  3139. @url{http://theworld.com/~cme/spki.txt, Simple Public-Key Infrastructure
  3140. (SPKI)}.
  3141. @item --extract=@var{directory}
  3142. @itemx -x @var{directory}
  3143. Read a single-item archive as served by substitute servers
  3144. (@pxref{Substitute}) and extract it to @var{directory}. This is a
  3145. low-level operation needed in only very narrow use cases; see below.
  3146. For example, the following command extracts the substitute for Emacs served
  3147. by @code{hydra.gnu.org} to @file{/tmp/emacs}:
  3148. @example
  3149. $ wget -O - \
  3150. https://hydra.gnu.org/nar/@dots{}-emacs-24.5 \
  3151. | bunzip2 | guix archive -x /tmp/emacs
  3152. @end example
  3153. Single-item archives are different from multiple-item archives produced by
  3154. @command{guix archive --export}; they contain a single store item, and they
  3155. do @emph{not} embed a signature. Thus this operation does @emph{no}
  3156. signature verification and its output should be considered unsafe.
  3157. The primary purpose of this operation is to facilitate inspection of archive
  3158. contents coming from possibly untrusted substitute servers.
  3159. @end table
  3160. @c *********************************************************************
  3161. @node Programmierschnittstelle
  3162. @chapter Programmierschnittstelle
  3163. GNU Guix provides several Scheme programming interfaces (APIs) to define,
  3164. build, and query packages. The first interface allows users to write
  3165. high-level package definitions. These definitions refer to familiar
  3166. packaging concepts, such as the name and version of a package, its build
  3167. system, and its dependencies. These definitions can then be turned into
  3168. concrete build actions.
  3169. Build actions are performed by the Guix daemon, on behalf of users. In a
  3170. standard setup, the daemon has write access to the store---the
  3171. @file{/gnu/store} directory---whereas users do not. The recommended setup
  3172. also has the daemon perform builds in chroots, under a specific build users,
  3173. to minimize interference with the rest of the system.
  3174. @cindex Ableitung
  3175. Lower-level APIs are available to interact with the daemon and the store.
  3176. To instruct the daemon to perform a build action, users actually provide it
  3177. with a @dfn{derivation}. A derivation is a low-level representation of the
  3178. build actions to be taken, and the environment in which they should
  3179. occur---derivations are to package definitions what assembly is to C
  3180. programs. The term ``derivation'' comes from the fact that build results
  3181. @emph{derive} from them.
  3182. This chapter describes all these APIs in turn, starting from high-level
  3183. package definitions.
  3184. @menu
  3185. * Pakete definieren:: Wie Sie neue Pakete definieren.
  3186. * Erstellungssysteme:: Angeben, wie Pakete erstellt werden.
  3187. * Der Store:: Den Paket-Store verändern.
  3188. * Ableitungen:: Systemnahe Schnittstelle für Paketableitungen.
  3189. * Die Store-Monade:: Rein funktionale Schnittstelle zum Store.
  3190. * G-Ausdrücke:: Erstellungsausdrücke verarbeiten.
  3191. * Invoking guix repl:: Fiddling with Guix interactively.
  3192. @end menu
  3193. @node Pakete definieren
  3194. @section Pakete definieren
  3195. The high-level interface to package definitions is implemented in the
  3196. @code{(guix packages)} and @code{(guix build-system)} modules. As an
  3197. example, the package definition, or @dfn{recipe}, for the GNU Hello package
  3198. looks like this:
  3199. @example
  3200. (define-module (gnu packages hello)
  3201. #:use-module (guix packages)
  3202. #:use-module (guix download)
  3203. #:use-module (guix build-system gnu)
  3204. #:use-module (guix licenses)
  3205. #:use-module (gnu packages gawk))
  3206. (define-public hello
  3207. (package
  3208. (name "hello")
  3209. (version "2.10")
  3210. (source (origin
  3211. (method url-fetch)
  3212. (uri (string-append "mirror://gnu/hello/hello-" version
  3213. ".tar.gz"))
  3214. (sha256
  3215. (base32
  3216. "0ssi1wpaf7plaswqqjwigppsg5fyh99vdlb9kzl7c9lng89ndq1i"))))
  3217. (build-system gnu-build-system)
  3218. (arguments '(#:configure-flags '("--enable-silent-rules")))
  3219. (inputs `(("gawk" ,gawk)))
  3220. (synopsis "Hello, GNU world: An example GNU package")
  3221. (description "Guess what GNU Hello prints!")
  3222. (home-page "http://www.gnu.org/software/hello/")
  3223. (license gpl3+)))
  3224. @end example
  3225. @noindent
  3226. Without being a Scheme expert, the reader may have guessed the meaning of
  3227. the various fields here. This expression binds the variable @code{hello} to
  3228. a @code{<package>} object, which is essentially a record (@pxref{SRFI-9,
  3229. Scheme records,, guile, GNU Guile Reference Manual}). This package object
  3230. can be inspected using procedures found in the @code{(guix packages)}
  3231. module; for instance, @code{(package-name hello)}
  3232. returns---surprise!---@code{"hello"}.
  3233. With luck, you may be able to import part or all of the definition of the
  3234. package you are interested in from another repository, using the @code{guix
  3235. import} command (@pxref{Aufruf von guix import}).
  3236. In the example above, @var{hello} is defined in a module of its own,
  3237. @code{(gnu packages hello)}. Technically, this is not strictly necessary,
  3238. but it is convenient to do so: all the packages defined in modules under
  3239. @code{(gnu packages @dots{})} are automatically known to the command-line
  3240. tools (@pxref{Paketmodule}).
  3241. There are a few points worth noting in the above package definition:
  3242. @itemize
  3243. @item
  3244. The @code{source} field of the package is an @code{<origin>} object
  3245. (@pxref{„origin“-Referenz}, for the complete reference). Here, the
  3246. @code{url-fetch} method from @code{(guix download)} is used, meaning that
  3247. the source is a file to be downloaded over FTP or HTTP.
  3248. The @code{mirror://gnu} prefix instructs @code{url-fetch} to use one of the
  3249. GNU mirrors defined in @code{(guix download)}.
  3250. The @code{sha256} field specifies the expected SHA256 hash of the file being
  3251. downloaded. It is mandatory, and allows Guix to check the integrity of the
  3252. file. The @code{(base32 @dots{})} form introduces the base32 representation
  3253. of the hash. You can obtain this information with @code{guix download}
  3254. (@pxref{Aufruf von guix download}) and @code{guix hash} (@pxref{Aufruf von guix hash}).
  3255. @cindex patches
  3256. When needed, the @code{origin} form can also have a @code{patches} field
  3257. listing patches to be applied, and a @code{snippet} field giving a Scheme
  3258. expression to modify the source code.
  3259. @item
  3260. @cindex GNU-Erstellungssystem
  3261. The @code{build-system} field specifies the procedure to build the package
  3262. (@pxref{Erstellungssysteme}). Here, @var{gnu-build-system} represents the
  3263. familiar GNU Build System, where packages may be configured, built, and
  3264. installed with the usual @code{./configure && make && make check && make
  3265. install} command sequence.
  3266. @item
  3267. The @code{arguments} field specifies options for the build system
  3268. (@pxref{Erstellungssysteme}). Here it is interpreted by @var{gnu-build-system}
  3269. as a request run @file{configure} with the @code{--enable-silent-rules}
  3270. flag.
  3271. @cindex quote
  3272. @cindex quoting
  3273. @findex '
  3274. @findex quote
  3275. What about these quote (@code{'}) characters? They are Scheme syntax to
  3276. introduce a literal list; @code{'} is synonymous with @code{quote}.
  3277. @xref{Expression Syntax, quoting,, guile, GNU Guile Reference Manual}, for
  3278. details. Here the value of the @code{arguments} field is a list of
  3279. arguments passed to the build system down the road, as with @code{apply}
  3280. (@pxref{Fly Evaluation, @code{apply},, guile, GNU Guile Reference Manual}).
  3281. The hash-colon (@code{#:}) sequence defines a Scheme @dfn{keyword}
  3282. (@pxref{Keywords,,, guile, GNU Guile Reference Manual}), and
  3283. @code{#:configure-flags} is a keyword used to pass a keyword argument to the
  3284. build system (@pxref{Coding With Keywords,,, guile, GNU Guile Reference
  3285. Manual}).
  3286. @item
  3287. The @code{inputs} field specifies inputs to the build process---i.e.,
  3288. build-time or run-time dependencies of the package. Here, we define an
  3289. input called @code{"gawk"} whose value is that of the @var{gawk} variable;
  3290. @var{gawk} is itself bound to a @code{<package>} object.
  3291. @cindex backquote (quasiquote)
  3292. @findex `
  3293. @findex quasiquote
  3294. @cindex comma (unquote)
  3295. @findex ,
  3296. @findex unquote
  3297. @findex ,@@
  3298. @findex unquote-splicing
  3299. Again, @code{`} (a backquote, synonymous with @code{quasiquote}) allows us
  3300. to introduce a literal list in the @code{inputs} field, while @code{,} (a
  3301. comma, synonymous with @code{unquote}) allows us to insert a value in that
  3302. list (@pxref{Expression Syntax, unquote,, guile, GNU Guile Reference
  3303. Manual}).
  3304. Note that GCC, Coreutils, Bash, and other essential tools do not need to be
  3305. specified as inputs here. Instead, @var{gnu-build-system} takes care of
  3306. ensuring that they are present (@pxref{Erstellungssysteme}).
  3307. However, any other dependencies need to be specified in the @code{inputs}
  3308. field. Any dependency not specified here will simply be unavailable to the
  3309. build process, possibly leading to a build failure.
  3310. @end itemize
  3311. @xref{„package“-Referenz}, for a full description of possible fields.
  3312. Once a package definition is in place, the package may actually be built
  3313. using the @code{guix build} command-line tool (@pxref{Aufruf von guix build}),
  3314. troubleshooting any build failures you encounter (@pxref{Fehlschläge beim Erstellen untersuchen}). You can easily jump back to the package definition using the
  3315. @command{guix edit} command (@pxref{Aufruf von guix edit}). @xref{Paketrichtlinien}, for more information on how to test package definitions, and
  3316. @ref{Aufruf von guix lint}, for information on how to check a definition for
  3317. style conformance.
  3318. @vindex GUIX_PACKAGE_PATH
  3319. Lastly, @pxref{Channels}, for information on how to extend the distribution
  3320. by adding your own package definitions in a ``channel''.
  3321. Finally, updating the package definition to a new upstream version can be
  3322. partly automated by the @command{guix refresh} command (@pxref{Aufruf von guix refresh}).
  3323. Behind the scenes, a derivation corresponding to the @code{<package>} object
  3324. is first computed by the @code{package-derivation} procedure. That
  3325. derivation is stored in a @code{.drv} file under @file{/gnu/store}. The
  3326. build actions it prescribes may then be realized by using the
  3327. @code{build-derivations} procedure (@pxref{Der Store}).
  3328. @deffn {Scheme Procedure} package-derivation @var{store} @var{package} [@var{system}]
  3329. Return the @code{<derivation>} object of @var{package} for @var{system}
  3330. (@pxref{Ableitungen}).
  3331. @var{package} must be a valid @code{<package>} object, and @var{system} must
  3332. be a string denoting the target system type---e.g., @code{"x86_64-linux"}
  3333. for an x86_64 Linux-based GNU system. @var{store} must be a connection to
  3334. the daemon, which operates on the store (@pxref{Der Store}).
  3335. @end deffn
  3336. @noindent
  3337. @cindex cross-compilation
  3338. Similarly, it is possible to compute a derivation that cross-builds a
  3339. package for some other system:
  3340. @deffn {Scheme Procedure} package-cross-derivation @var{store} @
  3341. @var{package} @var{target} [@var{system}] Return the @code{<derivation>}
  3342. object of @var{package} cross-built from @var{system} to @var{target}.
  3343. @var{target} must be a valid GNU triplet denoting the target hardware and
  3344. operating system, such as @code{"mips64el-linux-gnu"} (@pxref{Configuration
  3345. Names, GNU configuration triplets,, configure, GNU Configure and Build
  3346. System}).
  3347. @end deffn
  3348. @cindex package transformations
  3349. @cindex input rewriting
  3350. @cindex dependency tree rewriting
  3351. Packages can be manipulated in arbitrary ways. An example of a useful
  3352. transformation is @dfn{input rewriting}, whereby the dependency tree of a
  3353. package is rewritten by replacing specific inputs by others:
  3354. @deffn {Scheme Procedure} package-input-rewriting @var{replacements} @
  3355. [@var{rewrite-name}] Return a procedure that, when passed a package,
  3356. replaces its direct and indirect dependencies (but not its implicit inputs)
  3357. according to @var{replacements}. @var{replacements} is a list of package
  3358. pairs; the first element of each pair is the package to replace, and the
  3359. second one is the replacement.
  3360. Optionally, @var{rewrite-name} is a one-argument procedure that takes the
  3361. name of a package and returns its new name after rewrite.
  3362. @end deffn
  3363. @noindent
  3364. Consider this example:
  3365. @example
  3366. (define libressl-instead-of-openssl
  3367. ;; This is a procedure to replace OPENSSL by LIBRESSL,
  3368. ;; recursively.
  3369. (package-input-rewriting `((,openssl . ,libressl))))
  3370. (define git-with-libressl
  3371. (libressl-instead-of-openssl git))
  3372. @end example
  3373. @noindent
  3374. Here we first define a rewriting procedure that replaces @var{openssl} with
  3375. @var{libressl}. Then we use it to define a @dfn{variant} of the @var{git}
  3376. package that uses @var{libressl} instead of @var{openssl}. This is exactly
  3377. what the @option{--with-input} command-line option does (@pxref{Paketumwandlungsoptionen, @option{--with-input}}).
  3378. A more generic procedure to rewrite a package dependency graph is
  3379. @code{package-mapping}: it supports arbitrary changes to nodes in the graph.
  3380. @deffn {Scheme Procedure} package-mapping @var{proc} [@var{cut?}]
  3381. Return a procedure that, given a package, applies @var{proc} to all the
  3382. packages depended on and returns the resulting package. The procedure stops
  3383. recursion when @var{cut?} returns true for a given package.
  3384. @end deffn
  3385. @menu
  3386. * „package“-Referenz:: Der Datentyp für Pakete.
  3387. * „origin“-Referenz:: Datentyp für Paketursprünge.
  3388. @end menu
  3389. @node „package“-Referenz
  3390. @subsection @code{package} Reference
  3391. This section summarizes all the options available in @code{package}
  3392. declarations (@pxref{Pakete definieren}).
  3393. @deftp {Data Type} package
  3394. This is the data type representing a package recipe.
  3395. @table @asis
  3396. @item @code{name}
  3397. The name of the package, as a string.
  3398. @item @code{version}
  3399. The version of the package, as a string.
  3400. @item @code{source}
  3401. An object telling how the source code for the package should be acquired.
  3402. Most of the time, this is an @code{origin} object, which denotes a file
  3403. fetched from the Internet (@pxref{„origin“-Referenz}). It can also be any
  3404. other ``file-like'' object such as a @code{local-file}, which denotes a file
  3405. from the local file system (@pxref{G-Ausdrücke, @code{local-file}}).
  3406. @item @code{build-system}
  3407. The build system that should be used to build the package (@pxref{Erstellungssysteme}).
  3408. @item @code{arguments} (default: @code{'()})
  3409. The arguments that should be passed to the build system. This is a list,
  3410. typically containing sequential keyword-value pairs.
  3411. @item @code{inputs} (default: @code{'()})
  3412. @itemx @code{native-inputs} (default: @code{'()})
  3413. @itemx @code{propagated-inputs} (default: @code{'()})
  3414. @cindex inputs, of packages
  3415. These fields list dependencies of the package. Each one is a list of
  3416. tuples, where each tuple has a label for the input (a string) as its first
  3417. element, a package, origin, or derivation as its second element, and
  3418. optionally the name of the output thereof that should be used, which
  3419. defaults to @code{"out"} (@pxref{Pakete mit mehreren Ausgaben.}, for more
  3420. on package outputs). For example, the list below specifies three inputs:
  3421. @example
  3422. `(("libffi" ,libffi)
  3423. ("libunistring" ,libunistring)
  3424. ("glib:bin" ,glib "bin")) ;the "bin" output of Glib
  3425. @end example
  3426. @cindex cross compilation, package dependencies
  3427. The distinction between @code{native-inputs} and @code{inputs} is necessary
  3428. when considering cross-compilation. When cross-compiling, dependencies
  3429. listed in @code{inputs} are built for the @emph{target} architecture;
  3430. conversely, dependencies listed in @code{native-inputs} are built for the
  3431. architecture of the @emph{build} machine.
  3432. @code{native-inputs} is typically used to list tools needed at build time,
  3433. but not at run time, such as Autoconf, Automake, pkg-config, Gettext, or
  3434. Bison. @command{guix lint} can report likely mistakes in this area
  3435. (@pxref{Aufruf von guix lint}).
  3436. @anchor{package-propagated-inputs}
  3437. Lastly, @code{propagated-inputs} is similar to @code{inputs}, but the
  3438. specified packages will be automatically installed alongside the package
  3439. they belong to (@pxref{package-cmd-propagated-inputs, @command{guix
  3440. package}}, for information on how @command{guix package} deals with
  3441. propagated inputs.)
  3442. For example this is necessary when a C/C++ library needs headers of another
  3443. library to compile, or when a pkg-config file refers to another one @i{via}
  3444. its @code{Requires} field.
  3445. Another example where @code{propagated-inputs} is useful is for languages
  3446. that lack a facility to record the run-time search path akin to the
  3447. @code{RUNPATH} of ELF files; this includes Guile, Python, Perl, and more.
  3448. To ensure that libraries written in those languages can find library code
  3449. they depend on at run time, run-time dependencies must be listed in
  3450. @code{propagated-inputs} rather than @code{inputs}.
  3451. @item @code{self-native-input?} (default: @code{#f})
  3452. This is a Boolean field telling whether the package should use itself as a
  3453. native input when cross-compiling.
  3454. @item @code{outputs} (default: @code{'("out")})
  3455. The list of output names of the package. @xref{Pakete mit mehreren Ausgaben.}, for typical uses of additional outputs.
  3456. @item @code{native-search-paths} (default: @code{'()})
  3457. @itemx @code{search-paths} (default: @code{'()})
  3458. A list of @code{search-path-specification} objects describing search-path
  3459. environment variables honored by the package.
  3460. @item @code{replacement} (default: @code{#f})
  3461. This must be either @code{#f} or a package object that will be used as a
  3462. @dfn{replacement} for this package. @xref{Sicherheitsaktualisierungen, grafts}, for
  3463. details.
  3464. @item @code{synopsis}
  3465. Eine einzeilige Beschreibung des Pakets.
  3466. @item @code{description}
  3467. Eine ausführlichere Beschreibung des Pakets.
  3468. @item @code{license}
  3469. @cindex license, of packages
  3470. The license of the package; a value from @code{(guix licenses)}, or a list
  3471. of such values.
  3472. @item @code{home-page}
  3473. The URL to the home-page of the package, as a string.
  3474. @item @code{supported-systems} (default: @var{%supported-systems})
  3475. The list of systems supported by the package, as strings of the form
  3476. @code{architecture-kernel}, for example @code{"x86_64-linux"}.
  3477. @item @code{maintainers} (default: @code{'()})
  3478. The list of maintainers of the package, as @code{maintainer} objects.
  3479. @item @code{location} (default: source location of the @code{package} form)
  3480. The source location of the package. It is useful to override this when
  3481. inheriting from another package, in which case this field is not
  3482. automatically corrected.
  3483. @end table
  3484. @end deftp
  3485. @node „origin“-Referenz
  3486. @subsection @code{origin} Reference
  3487. This section summarizes all the options available in @code{origin}
  3488. declarations (@pxref{Pakete definieren}).
  3489. @deftp {Data Type} origin
  3490. This is the data type representing a source code origin.
  3491. @table @asis
  3492. @item @code{uri}
  3493. An object containing the URI of the source. The object type depends on the
  3494. @code{method} (see below). For example, when using the @var{url-fetch}
  3495. method of @code{(guix download)}, the valid @code{uri} values are: a URL
  3496. represented as a string, or a list thereof.
  3497. @item @code{method}
  3498. A procedure that handles the URI.
  3499. Examples include:
  3500. @table @asis
  3501. @item @var{url-fetch} from @code{(guix download)}
  3502. download a file from the HTTP, HTTPS, or FTP URL specified in the @code{uri}
  3503. field;
  3504. @vindex git-fetch
  3505. @item @var{git-fetch} from @code{(guix git-download)}
  3506. clone the Git version control repository, and check out the revision
  3507. specified in the @code{uri} field as a @code{git-reference} object; a
  3508. @code{git-reference} looks like this:
  3509. @example
  3510. (git-reference
  3511. (url "git://git.debian.org/git/pkg-shadow/shadow")
  3512. (commit "v4.1.5.1"))
  3513. @end example
  3514. @end table
  3515. @item @code{sha256}
  3516. A bytevector containing the SHA-256 hash of the source. Typically the
  3517. @code{base32} form is used here to generate the bytevector from a base-32
  3518. string.
  3519. You can obtain this information using @code{guix download} (@pxref{Aufruf von guix download}) or @code{guix hash} (@pxref{Aufruf von guix hash}).
  3520. @item @code{file-name} (default: @code{#f})
  3521. The file name under which the source code should be saved. When this is
  3522. @code{#f}, a sensible default value will be used in most cases. In case the
  3523. source is fetched from a URL, the file name from the URL will be used. For
  3524. version control checkouts, it is recommended to provide the file name
  3525. explicitly because the default is not very descriptive.
  3526. @item @code{patches} (default: @code{'()})
  3527. A list of file names, origins, or file-like objects (@pxref{G-Ausdrücke,
  3528. file-like objects}) pointing to patches to be applied to the source.
  3529. This list of patches must be unconditional. In particular, it cannot depend
  3530. on the value of @code{%current-system} or @code{%current-target-system}.
  3531. @item @code{snippet} (default: @code{#f})
  3532. A G-expression (@pxref{G-Ausdrücke}) or S-expression that will be run in
  3533. the source directory. This is a convenient way to modify the source,
  3534. sometimes more convenient than a patch.
  3535. @item @code{patch-flags} (default: @code{'("-p1")})
  3536. A list of command-line flags that should be passed to the @code{patch}
  3537. command.
  3538. @item @code{patch-inputs} (default: @code{#f})
  3539. Input packages or derivations to the patching process. When this is
  3540. @code{#f}, the usual set of inputs necessary for patching are provided, such
  3541. as GNU@tie{}Patch.
  3542. @item @code{modules} (default: @code{'()})
  3543. A list of Guile modules that should be loaded during the patching process
  3544. and while running the code in the @code{snippet} field.
  3545. @item @code{patch-guile} (default: @code{#f})
  3546. The Guile package that should be used in the patching process. When this is
  3547. @code{#f}, a sensible default is used.
  3548. @end table
  3549. @end deftp
  3550. @node Erstellungssysteme
  3551. @section Erstellungssysteme
  3552. @cindex build system
  3553. Each package definition specifies a @dfn{build system} and arguments for
  3554. that build system (@pxref{Pakete definieren}). This @code{build-system}
  3555. field represents the build procedure of the package, as well as implicit
  3556. dependencies of that build procedure.
  3557. Build systems are @code{<build-system>} objects. The interface to create
  3558. and manipulate them is provided by the @code{(guix build-system)} module,
  3559. and actual build systems are exported by specific modules.
  3560. @cindex bag (low-level package representation)
  3561. Under the hood, build systems first compile package objects to @dfn{bags}.
  3562. A @dfn{bag} is like a package, but with less ornamentation---in other words,
  3563. a bag is a lower-level representation of a package, which includes all the
  3564. inputs of that package, including some that were implicitly added by the
  3565. build system. This intermediate representation is then compiled to a
  3566. derivation (@pxref{Ableitungen}).
  3567. Build systems accept an optional list of @dfn{arguments}. In package
  3568. definitions, these are passed @i{via} the @code{arguments} field
  3569. (@pxref{Pakete definieren}). They are typically keyword arguments
  3570. (@pxref{Optional Arguments, keyword arguments in Guile,, guile, GNU Guile
  3571. Reference Manual}). The value of these arguments is usually evaluated in
  3572. the @dfn{build stratum}---i.e., by a Guile process launched by the daemon
  3573. (@pxref{Ableitungen}).
  3574. The main build system is @var{gnu-build-system}, which implements the
  3575. standard build procedure for GNU and many other packages. It is provided by
  3576. the @code{(guix build-system gnu)} module.
  3577. @defvr {Scheme Variable} gnu-build-system
  3578. @var{gnu-build-system} represents the GNU Build System, and variants thereof
  3579. (@pxref{Configuration, configuration and makefile conventions,, standards,
  3580. GNU Coding Standards}).
  3581. @cindex build phases
  3582. In a nutshell, packages using it are configured, built, and installed with
  3583. the usual @code{./configure && make && make check && make install} command
  3584. sequence. In practice, a few additional steps are often needed. All these
  3585. steps are split up in separate @dfn{phases}, notably@footnote{Please see the
  3586. @code{(guix build gnu-build-system)} modules for more details about the
  3587. build phases.}:
  3588. @table @code
  3589. @item unpack
  3590. Unpack the source tarball, and change the current directory to the extracted
  3591. source tree. If the source is actually a directory, copy it to the build
  3592. tree, and enter that directory.
  3593. @item patch-source-shebangs
  3594. Patch shebangs encountered in source files so they refer to the right store
  3595. file names. For instance, this changes @code{#!/bin/sh} to
  3596. @code{#!/gnu/store/@dots{}-bash-4.3/bin/sh}.
  3597. @item configure
  3598. Run the @file{configure} script with a number of default options, such as
  3599. @code{--prefix=/gnu/store/@dots{}}, as well as the options specified by the
  3600. @code{#:configure-flags} argument.
  3601. @item build
  3602. Run @code{make} with the list of flags specified with @code{#:make-flags}.
  3603. If the @code{#:parallel-build?} argument is true (the default), build with
  3604. @code{make -j}.
  3605. @item check
  3606. Run @code{make check}, or some other target specified with
  3607. @code{#:test-target}, unless @code{#:tests? #f} is passed. If the
  3608. @code{#:parallel-tests?} argument is true (the default), run @code{make
  3609. check -j}.
  3610. @item install
  3611. Run @code{make install} with the flags listed in @code{#:make-flags}.
  3612. @item patch-shebangs
  3613. Patch shebangs on the installed executable files.
  3614. @item strip
  3615. Strip debugging symbols from ELF files (unless @code{#:strip-binaries?} is
  3616. false), copying them to the @code{debug} output when available
  3617. (@pxref{Dateien zur Fehlersuche installieren}).
  3618. @end table
  3619. @vindex %standard-phases
  3620. The build-side module @code{(guix build gnu-build-system)} defines
  3621. @var{%standard-phases} as the default list of build phases.
  3622. @var{%standard-phases} is a list of symbol/procedure pairs, where the
  3623. procedure implements the actual phase.
  3624. The list of phases used for a particular package can be changed with the
  3625. @code{#:phases} parameter. For instance, passing:
  3626. @example
  3627. #:phases (modify-phases %standard-phases (delete 'configure))
  3628. @end example
  3629. means that all the phases described above will be used, except the
  3630. @code{configure} phase.
  3631. In addition, this build system ensures that the ``standard'' environment for
  3632. GNU packages is available. This includes tools such as GCC, libc,
  3633. Coreutils, Bash, Make, Diffutils, grep, and sed (see the @code{(guix
  3634. build-system gnu)} module for a complete list). We call these the
  3635. @dfn{implicit inputs} of a package, because package definitions do not have
  3636. to mention them.
  3637. @end defvr
  3638. Other @code{<build-system>} objects are defined to support other conventions
  3639. and tools used by free software packages. They inherit most of
  3640. @var{gnu-build-system}, and differ mainly in the set of inputs implicitly
  3641. added to the build process, and in the list of phases executed. Some of
  3642. these build systems are listed below.
  3643. @defvr {Scheme Variable} ant-build-system
  3644. This variable is exported by @code{(guix build-system ant)}. It implements
  3645. the build procedure for Java packages that can be built with
  3646. @url{http://ant.apache.org/, Ant build tool}.
  3647. It adds both @code{ant} and the @dfn{Java Development Kit} (JDK) as provided
  3648. by the @code{icedtea} package to the set of inputs. Different packages can
  3649. be specified with the @code{#:ant} and @code{#:jdk} parameters,
  3650. respectively.
  3651. When the original package does not provide a suitable Ant build file, the
  3652. parameter @code{#:jar-name} can be used to generate a minimal Ant build file
  3653. @file{build.xml} with tasks to build the specified jar archive. In this
  3654. case the parameter @code{#:source-dir} can be used to specify the source
  3655. sub-directory, defaulting to ``src''.
  3656. The @code{#:main-class} parameter can be used with the minimal ant buildfile
  3657. to specify the main class of the resulting jar. This makes the jar file
  3658. executable. The @code{#:test-include} parameter can be used to specify the
  3659. list of junit tests to run. It defaults to @code{(list "**/*Test.java")}.
  3660. The @code{#:test-exclude} can be used to disable some tests. It defaults to
  3661. @code{(list "**/Abstract*.java")}, because abstract classes cannot be run as
  3662. tests.
  3663. The parameter @code{#:build-target} can be used to specify the Ant task that
  3664. should be run during the @code{build} phase. By default the ``jar'' task
  3665. will be run.
  3666. @end defvr
  3667. @defvr {Scheme Variable} android-ndk-build-system
  3668. @cindex Android distribution
  3669. @cindex Android NDK build system
  3670. This variable is exported by @code{(guix build-system android-ndk)}. It
  3671. implements a build procedure for Android NDK (native development kit)
  3672. packages using a Guix-specific build process.
  3673. The build system assumes that packages install their public interface
  3674. (header) files to the subdirectory "include" of the "out" output and their
  3675. libraries to the subdirectory "lib" of the "out" output.
  3676. It's also assumed that the union of all the dependencies of a package has no
  3677. conflicting files.
  3678. For the time being, cross-compilation is not supported - so right now the
  3679. libraries and header files are assumed to be host tools.
  3680. @end defvr
  3681. @defvr {Scheme Variable} asdf-build-system/source
  3682. @defvrx {Scheme Variable} asdf-build-system/sbcl
  3683. @defvrx {Scheme Variable} asdf-build-system/ecl
  3684. These variables, exported by @code{(guix build-system asdf)}, implement
  3685. build procedures for Common Lisp packages using
  3686. @url{https://common-lisp.net/project/asdf/, ``ASDF''}. ASDF is a system
  3687. definition facility for Common Lisp programs and libraries.
  3688. The @code{asdf-build-system/source} system installs the packages in source
  3689. form, and can be loaded using any common lisp implementation, via ASDF. The
  3690. others, such as @code{asdf-build-system/sbcl}, install binary systems in the
  3691. format which a particular implementation understands. These build systems
  3692. can also be used to produce executable programs, or lisp images which
  3693. contain a set of packages pre-loaded.
  3694. The build system uses naming conventions. For binary packages, the package
  3695. name should be prefixed with the lisp implementation, such as @code{sbcl-}
  3696. for @code{asdf-build-system/sbcl}.
  3697. Additionally, the corresponding source package should be labeled using the
  3698. same convention as python packages (see @ref{Python-Module}), using the
  3699. @code{cl-} prefix.
  3700. For binary packages, each system should be defined as a Guix package. If
  3701. one package @code{origin} contains several systems, package variants can be
  3702. created in order to build all the systems. Source packages, which use
  3703. @code{asdf-build-system/source}, may contain several systems.
  3704. In order to create executable programs and images, the build-side procedures
  3705. @code{build-program} and @code{build-image} can be used. They should be
  3706. called in a build phase after the @code{create-symlinks} phase, so that the
  3707. system which was just built can be used within the resulting image.
  3708. @code{build-program} requires a list of Common Lisp expressions to be passed
  3709. as the @code{#:entry-program} argument.
  3710. If the system is not defined within its own @code{.asd} file of the same
  3711. name, then the @code{#:asd-file} parameter should be used to specify which
  3712. file the system is defined in. Furthermore, if the package defines a system
  3713. for its tests in a separate file, it will be loaded before the tests are run
  3714. if it is specified by the @code{#:test-asd-file} parameter. If it is not
  3715. set, the files @code{<system>-tests.asd}, @code{<system>-test.asd},
  3716. @code{tests.asd}, and @code{test.asd} will be tried if they exist.
  3717. If for some reason the package must be named in a different way than the
  3718. naming conventions suggest, the @code{#:asd-system-name} parameter can be
  3719. used to specify the name of the system.
  3720. @end defvr
  3721. @defvr {Scheme Variable} cargo-build-system
  3722. @cindex Rust programming language
  3723. @cindex Cargo (Rust build system)
  3724. This variable is exported by @code{(guix build-system cargo)}. It supports
  3725. builds of packages using Cargo, the build tool of the
  3726. @uref{https://www.rust-lang.org, Rust programming language}.
  3727. In its @code{configure} phase, this build system replaces dependencies
  3728. specified in the @file{Carto.toml} file with inputs to the Guix package.
  3729. The @code{install} phase installs the binaries, and it also installs the
  3730. source code and @file{Cargo.toml} file.
  3731. @end defvr
  3732. @cindex Clojure (programming language)
  3733. @cindex simple Clojure build system
  3734. @defvr {Scheme Variable} clojure-build-system
  3735. This variable is exported by @code{(guix build-system clojure)}. It
  3736. implements a simple build procedure for @uref{https://clojure.org/, Clojure}
  3737. packages using plain old @code{compile} in Clojure. Cross-compilation is
  3738. not supported yet.
  3739. It adds @code{clojure}, @code{icedtea} and @code{zip} to the set of inputs.
  3740. Different packages can be specified with the @code{#:clojure}, @code{#:jdk}
  3741. and @code{#:zip} parameters, respectively.
  3742. A list of source directories, test directories and jar names can be
  3743. specified with the @code{#:source-dirs}, @code{#:test-dirs} and
  3744. @code{#:jar-names} parameters, respectively. Compile directory and main
  3745. class can be specified with the @code{#:compile-dir} and @code{#:main-class}
  3746. parameters, respectively. Other parameters are documented below.
  3747. This build system is an extension of @var{ant-build-system}, but with the
  3748. following phases changed:
  3749. @table @code
  3750. @item build
  3751. This phase calls @code{compile} in Clojure to compile source files and runs
  3752. @command{jar} to create jars from both source files and compiled files
  3753. according to the include list and exclude list specified in
  3754. @code{#:aot-include} and @code{#:aot-exclude}, respectively. The exclude
  3755. list has priority over the include list. These lists consist of symbols
  3756. representing Clojure libraries or the special keyword @code{#:all}
  3757. representing all Clojure libraries found under the source directories. The
  3758. parameter @code{#:omit-source?} decides if source should be included into
  3759. the jars.
  3760. @item check
  3761. This phase runs tests according to the include list and exclude list
  3762. specified in @code{#:test-include} and @code{#:test-exclude}, respectively.
  3763. Their meanings are analogous to that of @code{#:aot-include} and
  3764. @code{#:aot-exclude}, except that the special keyword @code{#:all} now
  3765. stands for all Clojure libraries found under the test directories. The
  3766. parameter @code{#:tests?} decides if tests should be run.
  3767. @item install
  3768. This phase installs all jars built previously.
  3769. @end table
  3770. Apart from the above, this build system also contains an additional phase:
  3771. @table @code
  3772. @item install-doc
  3773. This phase installs all top-level files with base name matching
  3774. @var{%doc-regex}. A different regex can be specified with the
  3775. @code{#:doc-regex} parameter. All files (recursively) inside the
  3776. documentation directories specified in @code{#:doc-dirs} are installed as
  3777. well.
  3778. @end table
  3779. @end defvr
  3780. @defvr {Scheme Variable} cmake-build-system
  3781. This variable is exported by @code{(guix build-system cmake)}. It
  3782. implements the build procedure for packages using the
  3783. @url{http://www.cmake.org, CMake build tool}.
  3784. It automatically adds the @code{cmake} package to the set of inputs. Which
  3785. package is used can be specified with the @code{#:cmake} parameter.
  3786. The @code{#:configure-flags} parameter is taken as a list of flags passed to
  3787. the @command{cmake} command. The @code{#:build-type} parameter specifies in
  3788. abstract terms the flags passed to the compiler; it defaults to
  3789. @code{"RelWithDebInfo"} (short for ``release mode with debugging
  3790. information''), which roughly means that code is compiled with @code{-O2
  3791. -g}, as is the case for Autoconf-based packages by default.
  3792. @end defvr
  3793. @defvr {Scheme Variable} go-build-system
  3794. This variable is exported by @code{(guix build-system go)}. It implements a
  3795. build procedure for Go packages using the standard
  3796. @url{https://golang.org/cmd/go/#hdr-Compile_packages_and_dependencies, Go
  3797. build mechanisms}.
  3798. The user is expected to provide a value for the key @code{#:import-path}
  3799. and, in some cases, @code{#:unpack-path}. The
  3800. @url{https://golang.org/doc/code.html#ImportPaths, import path} corresponds
  3801. to the file system path expected by the package's build scripts and any
  3802. referring packages, and provides a unique way to refer to a Go package. It
  3803. is typically based on a combination of the package source code's remote URI
  3804. and file system hierarchy structure. In some cases, you will need to unpack
  3805. the package's source code to a different directory structure than the one
  3806. indicated by the import path, and @code{#:unpack-path} should be used in
  3807. such cases.
  3808. Packages that provide Go libraries should be installed along with their
  3809. source code. The key @code{#:install-source?}, which defaults to @code{#t},
  3810. controls whether or not the source code is installed. It can be set to
  3811. @code{#f} for packages that only provide executable files.
  3812. @end defvr
  3813. @defvr {Scheme Variable} glib-or-gtk-build-system
  3814. This variable is exported by @code{(guix build-system glib-or-gtk)}. It is
  3815. intended for use with packages making use of GLib or GTK+.
  3816. This build system adds the following two phases to the ones defined by
  3817. @var{gnu-build-system}:
  3818. @table @code
  3819. @item glib-or-gtk-wrap
  3820. The phase @code{glib-or-gtk-wrap} ensures that programs in @file{bin/} are
  3821. able to find GLib ``schemas'' and
  3822. @uref{https://developer.gnome.org/gtk3/stable/gtk-running.html, GTK+
  3823. modules}. This is achieved by wrapping the programs in launch scripts that
  3824. appropriately set the @code{XDG_DATA_DIRS} and @code{GTK_PATH} environment
  3825. variables.
  3826. It is possible to exclude specific package outputs from that wrapping
  3827. process by listing their names in the
  3828. @code{#:glib-or-gtk-wrap-excluded-outputs} parameter. This is useful when
  3829. an output is known not to contain any GLib or GTK+ binaries, and where
  3830. wrapping would gratuitously add a dependency of that output on GLib and
  3831. GTK+.
  3832. @item glib-or-gtk-compile-schemas
  3833. The phase @code{glib-or-gtk-compile-schemas} makes sure that all
  3834. @uref{https://developer.gnome.org/gio/stable/glib-compile-schemas.html,
  3835. GSettings schemas} of GLib are compiled. Compilation is performed by the
  3836. @command{glib-compile-schemas} program. It is provided by the package
  3837. @code{glib:bin} which is automatically imported by the build system. The
  3838. @code{glib} package providing @command{glib-compile-schemas} can be
  3839. specified with the @code{#:glib} parameter.
  3840. @end table
  3841. Both phases are executed after the @code{install} phase.
  3842. @end defvr
  3843. @defvr {Scheme Variable} guile-build-system
  3844. This build system is for Guile packages that consist exclusively of Scheme
  3845. code and that are so lean that they don't even have a makefile, let alone a
  3846. @file{configure} script. It compiles Scheme code using @command{guild
  3847. compile} (@pxref{Compilation,,, guile, GNU Guile Reference Manual}) and
  3848. installs the @file{.scm} and @file{.go} files in the right place. It also
  3849. installs documentation.
  3850. This build system supports cross-compilation by using the @code{--target}
  3851. option of @command{guild compile}.
  3852. Packages built with @code{guile-build-system} must provide a Guile package
  3853. in their @code{native-inputs} field.
  3854. @end defvr
  3855. @defvr {Scheme Variable} minify-build-system
  3856. This variable is exported by @code{(guix build-system minify)}. It
  3857. implements a minification procedure for simple JavaScript packages.
  3858. It adds @code{uglify-js} to the set of inputs and uses it to compress all
  3859. JavaScript files in the @file{src} directory. A different minifier package
  3860. can be specified with the @code{#:uglify-js} parameter, but it is expected
  3861. that the package writes the minified code to the standard output.
  3862. When the input JavaScript files are not all located in the @file{src}
  3863. directory, the parameter @code{#:javascript-files} can be used to specify a
  3864. list of file names to feed to the minifier.
  3865. @end defvr
  3866. @defvr {Scheme Variable} ocaml-build-system
  3867. This variable is exported by @code{(guix build-system ocaml)}. It
  3868. implements a build procedure for @uref{https://ocaml.org, OCaml} packages,
  3869. which consists of choosing the correct set of commands to run for each
  3870. package. OCaml packages can expect many different commands to be run. This
  3871. build system will try some of them.
  3872. When the package has a @file{setup.ml} file present at the top-level, it
  3873. will run @code{ocaml setup.ml -configure}, @code{ocaml setup.ml -build} and
  3874. @code{ocaml setup.ml -install}. The build system will assume that this file
  3875. was generated by @uref{http://oasis.forge.ocamlcore.org/, OASIS} and will
  3876. take care of setting the prefix and enabling tests if they are not
  3877. disabled. You can pass configure and build flags with the
  3878. @code{#:configure-flags} and @code{#:build-flags}. The @code{#:test-flags}
  3879. key can be passed to change the set of flags used to enable tests. The
  3880. @code{#:use-make?} key can be used to bypass this system in the build and
  3881. install phases.
  3882. When the package has a @file{configure} file, it is assumed that it is a
  3883. hand-made configure script that requires a different argument format than in
  3884. the @code{gnu-build-system}. You can add more flags with the
  3885. @code{#:configure-flags} key.
  3886. When the package has a @file{Makefile} file (or @code{#:use-make?} is
  3887. @code{#t}), it will be used and more flags can be passed to the build and
  3888. install phases with the @code{#:make-flags} key.
  3889. Finally, some packages do not have these files and use a somewhat standard
  3890. location for its build system. In that case, the build system will run
  3891. @code{ocaml pkg/pkg.ml} or @code{ocaml pkg/build.ml} and take care of
  3892. providing the path to the required findlib module. Additional flags can be
  3893. passed via the @code{#:build-flags} key. Install is taken care of by
  3894. @command{opam-installer}. In this case, the @code{opam} package must be
  3895. added to the @code{native-inputs} field of the package definition.
  3896. Note that most OCaml packages assume they will be installed in the same
  3897. directory as OCaml, which is not what we want in guix. In particular, they
  3898. will install @file{.so} files in their module's directory, which is usually
  3899. fine because it is in the OCaml compiler directory. In guix though, these
  3900. libraries cannot be found and we use @code{CAML_LD_LIBRARY_PATH}. This
  3901. variable points to @file{lib/ocaml/site-lib/stubslibs} and this is where
  3902. @file{.so} libraries should be installed.
  3903. @end defvr
  3904. @defvr {Scheme Variable} python-build-system
  3905. This variable is exported by @code{(guix build-system python)}. It
  3906. implements the more or less standard build procedure used by Python
  3907. packages, which consists in running @code{python setup.py build} and then
  3908. @code{python setup.py install --prefix=/gnu/store/@dots{}}.
  3909. For packages that install stand-alone Python programs under @code{bin/}, it
  3910. takes care of wrapping these programs so that their @code{PYTHONPATH}
  3911. environment variable points to all the Python libraries they depend on.
  3912. Which Python package is used to perform the build can be specified with the
  3913. @code{#:python} parameter. This is a useful way to force a package to be
  3914. built for a specific version of the Python interpreter, which might be
  3915. necessary if the package is only compatible with a single interpreter
  3916. version.
  3917. By default guix calls @code{setup.py} under control of @code{setuptools},
  3918. much like @command{pip} does. Some packages are not compatible with
  3919. setuptools (and pip), thus you can disable this by setting the
  3920. @code{#:use-setuptools} parameter to @code{#f}.
  3921. @end defvr
  3922. @defvr {Scheme Variable} perl-build-system
  3923. This variable is exported by @code{(guix build-system perl)}. It implements
  3924. the standard build procedure for Perl packages, which either consists in
  3925. running @code{perl Build.PL --prefix=/gnu/store/@dots{}}, followed by
  3926. @code{Build} and @code{Build install}; or in running @code{perl Makefile.PL
  3927. PREFIX=/gnu/store/@dots{}}, followed by @code{make} and @code{make install},
  3928. depending on which of @code{Build.PL} or @code{Makefile.PL} is present in
  3929. the package distribution. Preference is given to the former if both
  3930. @code{Build.PL} and @code{Makefile.PL} exist in the package distribution.
  3931. This preference can be reversed by specifying @code{#t} for the
  3932. @code{#:make-maker?} parameter.
  3933. The initial @code{perl Makefile.PL} or @code{perl Build.PL} invocation
  3934. passes flags specified by the @code{#:make-maker-flags} or
  3935. @code{#:module-build-flags} parameter, respectively.
  3936. Which Perl package is used can be specified with @code{#:perl}.
  3937. @end defvr
  3938. @defvr {Scheme Variable} r-build-system
  3939. This variable is exported by @code{(guix build-system r)}. It implements
  3940. the build procedure used by @uref{http://r-project.org, R} packages, which
  3941. essentially is little more than running @code{R CMD INSTALL
  3942. --library=/gnu/store/@dots{}} in an environment where @code{R_LIBS_SITE}
  3943. contains the paths to all R package inputs. Tests are run after
  3944. installation using the R function @code{tools::testInstalledPackage}.
  3945. @end defvr
  3946. @defvr {Scheme Variable} texlive-build-system
  3947. This variable is exported by @code{(guix build-system texlive)}. It is used
  3948. to build TeX packages in batch mode with a specified engine. The build
  3949. system sets the @code{TEXINPUTS} variable to find all TeX source files in
  3950. the inputs.
  3951. By default it runs @code{luatex} on all files ending on @code{ins}. A
  3952. different engine and format can be specified with the @code{#:tex-format}
  3953. argument. Different build targets can be specified with the
  3954. @code{#:build-targets} argument, which expects a list of file names. The
  3955. build system adds only @code{texlive-bin} and @code{texlive-latex-base}
  3956. (both from @code{(gnu packages tex}) to the inputs. Both can be overridden
  3957. with the arguments @code{#:texlive-bin} and @code{#:texlive-latex-base},
  3958. respectively.
  3959. The @code{#:tex-directory} parameter tells the build system where to install
  3960. the built files under the texmf tree.
  3961. @end defvr
  3962. @defvr {Scheme Variable} ruby-build-system
  3963. This variable is exported by @code{(guix build-system ruby)}. It implements
  3964. the RubyGems build procedure used by Ruby packages, which involves running
  3965. @code{gem build} followed by @code{gem install}.
  3966. The @code{source} field of a package that uses this build system typically
  3967. references a gem archive, since this is the format that Ruby developers use
  3968. when releasing their software. The build system unpacks the gem archive,
  3969. potentially patches the source, runs the test suite, repackages the gem, and
  3970. installs it. Additionally, directories and tarballs may be referenced to
  3971. allow building unreleased gems from Git or a traditional source release
  3972. tarball.
  3973. Which Ruby package is used can be specified with the @code{#:ruby}
  3974. parameter. A list of additional flags to be passed to the @command{gem}
  3975. command can be specified with the @code{#:gem-flags} parameter.
  3976. @end defvr
  3977. @defvr {Scheme Variable} waf-build-system
  3978. This variable is exported by @code{(guix build-system waf)}. It implements
  3979. a build procedure around the @code{waf} script. The common
  3980. phases---@code{configure}, @code{build}, and @code{install}---are
  3981. implemented by passing their names as arguments to the @code{waf} script.
  3982. The @code{waf} script is executed by the Python interpreter. Which Python
  3983. package is used to run the script can be specified with the @code{#:python}
  3984. parameter.
  3985. @end defvr
  3986. @defvr {Scheme Variable} scons-build-system
  3987. This variable is exported by @code{(guix build-system scons)}. It
  3988. implements the build procedure used by the SCons software construction
  3989. tool. This build system runs @code{scons} to build the package, @code{scons
  3990. test} to run tests, and then @code{scons install} to install the package.
  3991. Additional flags to be passed to @code{scons} can be specified with the
  3992. @code{#:scons-flags} parameter. The version of Python used to run SCons can
  3993. be specified by selecting the appropriate SCons package with the
  3994. @code{#:scons} parameter.
  3995. @end defvr
  3996. @defvr {Scheme Variable} haskell-build-system
  3997. This variable is exported by @code{(guix build-system haskell)}. It
  3998. implements the Cabal build procedure used by Haskell packages, which
  3999. involves running @code{runhaskell Setup.hs configure
  4000. --prefix=/gnu/store/@dots{}} and @code{runhaskell Setup.hs build}. Instead
  4001. of installing the package by running @code{runhaskell Setup.hs install}, to
  4002. avoid trying to register libraries in the read-only compiler store
  4003. directory, the build system uses @code{runhaskell Setup.hs copy}, followed
  4004. by @code{runhaskell Setup.hs register}. In addition, the build system
  4005. generates the package documentation by running @code{runhaskell Setup.hs
  4006. haddock}, unless @code{#:haddock? #f} is passed. Optional Haddock
  4007. parameters can be passed with the help of the @code{#:haddock-flags}
  4008. parameter. If the file @code{Setup.hs} is not found, the build system looks
  4009. for @code{Setup.lhs} instead.
  4010. Which Haskell compiler is used can be specified with the @code{#:haskell}
  4011. parameter which defaults to @code{ghc}.
  4012. @end defvr
  4013. @defvr {Scheme Variable} dub-build-system
  4014. This variable is exported by @code{(guix build-system dub)}. It implements
  4015. the Dub build procedure used by D packages, which involves running @code{dub
  4016. build} and @code{dub run}. Installation is done by copying the files
  4017. manually.
  4018. Which D compiler is used can be specified with the @code{#:ldc} parameter
  4019. which defaults to @code{ldc}.
  4020. @end defvr
  4021. @defvr {Scheme Variable} emacs-build-system
  4022. This variable is exported by @code{(guix build-system emacs)}. It
  4023. implements an installation procedure similar to the packaging system of
  4024. Emacs itself (@pxref{Packages,,, emacs, The GNU Emacs Manual}).
  4025. It first creates the @code{@var{package}-autoloads.el} file, then it byte
  4026. compiles all Emacs Lisp files. Differently from the Emacs packaging system,
  4027. the Info documentation files are moved to the standard documentation
  4028. directory and the @file{dir} file is deleted. Each package is installed in
  4029. its own directory under @file{share/emacs/site-lisp/guix.d}.
  4030. @end defvr
  4031. @defvr {Scheme Variable} font-build-system
  4032. This variable is exported by @code{(guix build-system font)}. It implements
  4033. an installation procedure for font packages where upstream provides
  4034. pre-compiled TrueType, OpenType, etc.@: font files that merely need to be
  4035. copied into place. It copies font files to standard locations in the output
  4036. directory.
  4037. @end defvr
  4038. @defvr {Scheme Variable} meson-build-system
  4039. This variable is exported by @code{(guix build-system meson)}. It
  4040. implements the build procedure for packages that use
  4041. @url{http://mesonbuild.com, Meson} as their build system.
  4042. It adds both Meson and @uref{https://ninja-build.org/, Ninja} to the set of
  4043. inputs, and they can be changed with the parameters @code{#:meson} and
  4044. @code{#:ninja} if needed. The default Meson is @code{meson-for-build},
  4045. which is special because it doesn't clear the @code{RUNPATH} of binaries and
  4046. libraries when they are installed.
  4047. This build system is an extension of @var{gnu-build-system}, but with the
  4048. following phases changed to some specific for Meson:
  4049. @table @code
  4050. @item configure
  4051. The phase runs @code{meson} with the flags specified in
  4052. @code{#:configure-flags}. The flag @code{--build-type} is always set to
  4053. @code{plain} unless something else is specified in @code{#:build-type}.
  4054. @item build
  4055. The phase runs @code{ninja} to build the package in parallel by default, but
  4056. this can be changed with @code{#:parallel-build?}.
  4057. @item check
  4058. The phase runs @code{ninja} with the target specified in
  4059. @code{#:test-target}, which is @code{"test"} by default.
  4060. @item install
  4061. The phase runs @code{ninja install} and can not be changed.
  4062. @end table
  4063. Apart from that, the build system also adds the following phases:
  4064. @table @code
  4065. @item fix-runpath
  4066. This phase ensures that all binaries can find the libraries they need. It
  4067. searches for required libraries in subdirectories of the package being
  4068. built, and adds those to @code{RUNPATH} where needed. It also removes
  4069. references to libraries left over from the build phase by
  4070. @code{meson-for-build}, such as test dependencies, that aren't actually
  4071. required for the program to run.
  4072. @item glib-or-gtk-wrap
  4073. This phase is the phase provided by @code{glib-or-gtk-build-system}, and it
  4074. is not enabled by default. It can be enabled with @code{#:glib-or-gtk?}.
  4075. @item glib-or-gtk-compile-schemas
  4076. This phase is the phase provided by @code{glib-or-gtk-build-system}, and it
  4077. is not enabled by default. It can be enabled with @code{#:glib-or-gtk?}.
  4078. @end table
  4079. @end defvr
  4080. Lastly, for packages that do not need anything as sophisticated, a
  4081. ``trivial'' build system is provided. It is trivial in the sense that it
  4082. provides basically no support: it does not pull any implicit inputs, and
  4083. does not have a notion of build phases.
  4084. @defvr {Scheme Variable} trivial-build-system
  4085. This variable is exported by @code{(guix build-system trivial)}.
  4086. This build system requires a @code{#:builder} argument. This argument must
  4087. be a Scheme expression that builds the package output(s)---as with
  4088. @code{build-expression->derivation} (@pxref{Ableitungen,
  4089. @code{build-expression->derivation}}).
  4090. @end defvr
  4091. @node Der Store
  4092. @section Der Store
  4093. @cindex Store
  4094. @cindex store items
  4095. @cindex store paths
  4096. Conceptually, the @dfn{store} is the place where derivations that have been
  4097. built successfully are stored---by default, @file{/gnu/store}.
  4098. Sub-directories in the store are referred to as @dfn{store items} or
  4099. sometimes @dfn{store paths}. The store has an associated database that
  4100. contains information such as the store paths referred to by each store path,
  4101. and the list of @emph{valid} store items---results of successful builds.
  4102. This database resides in @file{@var{localstatedir}/guix/db}, where
  4103. @var{localstatedir} is the state directory specified @i{via}
  4104. @option{--localstatedir} at configure time, usually @file{/var}.
  4105. The store is @emph{always} accessed by the daemon on behalf of its clients
  4106. (@pxref{Aufruf des guix-daemon}). To manipulate the store, clients connect to
  4107. the daemon over a Unix-domain socket, send requests to it, and read the
  4108. result---these are remote procedure calls, or RPCs.
  4109. @quotation Anmerkung
  4110. Users must @emph{never} modify files under @file{/gnu/store} directly. This
  4111. would lead to inconsistencies and break the immutability assumptions of
  4112. Guix's functional model (@pxref{Einführung}).
  4113. @xref{Aufruf von guix gc, @command{guix gc --verify}}, for information on how
  4114. to check the integrity of the store and attempt recovery from accidental
  4115. modifications.
  4116. @end quotation
  4117. The @code{(guix store)} module provides procedures to connect to the daemon,
  4118. and to perform RPCs. These are described below. By default,
  4119. @code{open-connection}, and thus all the @command{guix} commands, connect to
  4120. the local daemon or to the URI specified by the @code{GUIX_DAEMON_SOCKET}
  4121. environment variable.
  4122. @defvr {Environment Variable} GUIX_DAEMON_SOCKET
  4123. When set, the value of this variable should be a file name or a URI
  4124. designating the daemon endpoint. When it is a file name, it denotes a
  4125. Unix-domain socket to connect to. In addition to file names, the supported
  4126. URI schemes are:
  4127. @table @code
  4128. @item file
  4129. @itemx unix
  4130. These are for Unix-domain sockets.
  4131. @code{file:///var/guix/daemon-socket/socket} is equivalent to
  4132. @file{/var/guix/daemon-socket/socket}.
  4133. @item guix
  4134. @cindex Daemon, Fernzugriff
  4135. @cindex Fernzugriff auf den Daemon
  4136. @cindex Daemon, Einrichten auf Clustern
  4137. @cindex Cluster, Einrichtung des Daemons
  4138. These URIs denote connections over TCP/IP, without encryption nor
  4139. authentication of the remote host. The URI must specify the host name and
  4140. optionally a port number (by default port 44146 is used):
  4141. @example
  4142. guix://master.guix.example.org:1234
  4143. @end example
  4144. This setup is suitable on local networks, such as clusters, where only
  4145. trusted nodes may connect to the build daemon at
  4146. @code{master.guix.example.org}.
  4147. The @code{--listen} option of @command{guix-daemon} can be used to instruct
  4148. it to listen for TCP connections (@pxref{Aufruf des guix-daemon,
  4149. @code{--listen}}).
  4150. @item ssh
  4151. @cindex SSH access to build daemons
  4152. These URIs allow you to connect to a remote daemon over SSH@footnote{This
  4153. feature requires Guile-SSH (@pxref{Voraussetzungen}).}. A typical URL might
  4154. look like this:
  4155. @example
  4156. ssh://charlie@@guix.example.org:22
  4157. @end example
  4158. As for @command{guix copy}, the usual OpenSSH client configuration files are
  4159. honored (@pxref{Aufruf von guix copy}).
  4160. @end table
  4161. Additional URI schemes may be supported in the future.
  4162. @c XXX: Remove this note when the protocol incurs fewer round trips
  4163. @c and when (guix derivations) no longer relies on file system access.
  4164. @quotation Anmerkung
  4165. The ability to connect to remote build daemons is considered experimental as
  4166. of @value{VERSION}. Please get in touch with us to share any problems or
  4167. suggestions you may have (@pxref{Mitwirken}).
  4168. @end quotation
  4169. @end defvr
  4170. @deffn {Scheme Procedure} open-connection [@var{uri}] [#:reserve-space? #t]
  4171. Connect to the daemon over the Unix-domain socket at @var{uri} (a string).
  4172. When @var{reserve-space?} is true, instruct it to reserve a little bit of
  4173. extra space on the file system so that the garbage collector can still
  4174. operate should the disk become full. Return a server object.
  4175. @var{file} defaults to @var{%default-socket-path}, which is the normal
  4176. location given the options that were passed to @command{configure}.
  4177. @end deffn
  4178. @deffn {Scheme Procedure} close-connection @var{server}
  4179. Close the connection to @var{server}.
  4180. @end deffn
  4181. @defvr {Scheme Variable} current-build-output-port
  4182. This variable is bound to a SRFI-39 parameter, which refers to the port
  4183. where build and error logs sent by the daemon should be written.
  4184. @end defvr
  4185. Procedures that make RPCs all take a server object as their first argument.
  4186. @deffn {Scheme Procedure} valid-path? @var{server} @var{path}
  4187. @cindex invalid store items
  4188. Return @code{#t} when @var{path} designates a valid store item and @code{#f}
  4189. otherwise (an invalid item may exist on disk but still be invalid, for
  4190. instance because it is the result of an aborted or failed build.)
  4191. A @code{&nix-protocol-error} condition is raised if @var{path} is not
  4192. prefixed by the store directory (@file{/gnu/store}).
  4193. @end deffn
  4194. @deffn {Scheme Procedure} add-text-to-store @var{server} @var{name} @var{text} [@var{references}]
  4195. Add @var{text} under file @var{name} in the store, and return its store
  4196. path. @var{references} is the list of store paths referred to by the
  4197. resulting store path.
  4198. @end deffn
  4199. @deffn {Scheme Procedure} build-derivations @var{server} @var{derivations}
  4200. Build @var{derivations} (a list of @code{<derivation>} objects or derivation
  4201. paths), and return when the worker is done building them. Return @code{#t}
  4202. on success.
  4203. @end deffn
  4204. Note that the @code{(guix monads)} module provides a monad as well as
  4205. monadic versions of the above procedures, with the goal of making it more
  4206. convenient to work with code that accesses the store (@pxref{Die Store-Monade}).
  4207. @c FIXME
  4208. @i{This section is currently incomplete.}
  4209. @node Ableitungen
  4210. @section Ableitungen
  4211. @cindex derivations
  4212. Low-level build actions and the environment in which they are performed are
  4213. represented by @dfn{derivations}. A derivation contains the following
  4214. pieces of information:
  4215. @itemize
  4216. @item
  4217. The outputs of the derivation---derivations produce at least one file or
  4218. directory in the store, but may produce more.
  4219. @item
  4220. The inputs of the derivations, which may be other derivations or plain files
  4221. in the store (patches, build scripts, etc.)
  4222. @item
  4223. The system type targeted by the derivation---e.g., @code{x86_64-linux}.
  4224. @item
  4225. The file name of a build script in the store, along with the arguments to be
  4226. passed.
  4227. @item
  4228. A list of environment variables to be defined.
  4229. @end itemize
  4230. @cindex derivation path
  4231. Derivations allow clients of the daemon to communicate build actions to the
  4232. store. They exist in two forms: as an in-memory representation, both on the
  4233. client- and daemon-side, and as files in the store whose name end in
  4234. @code{.drv}---these files are referred to as @dfn{derivation paths}.
  4235. Derivations paths can be passed to the @code{build-derivations} procedure to
  4236. perform the build actions they prescribe (@pxref{Der Store}).
  4237. @cindex fixed-output derivations
  4238. Operations such as file downloads and version-control checkouts for which
  4239. the expected content hash is known in advance are modeled as
  4240. @dfn{fixed-output derivations}. Unlike regular derivations, the outputs of
  4241. a fixed-output derivation are independent of its inputs---e.g., a source
  4242. code download produces the same result regardless of the download method and
  4243. tools being used.
  4244. The @code{(guix derivations)} module provides a representation of
  4245. derivations as Scheme objects, along with procedures to create and otherwise
  4246. manipulate derivations. The lowest-level primitive to create a derivation
  4247. is the @code{derivation} procedure:
  4248. @deffn {Scheme Procedure} derivation @var{store} @var{name} @var{builder} @
  4249. @var{args} [#:outputs '("out")] [#:hash #f] [#:hash-algo #f] @ [#:recursive?
  4250. #f] [#:inputs '()] [#:env-vars '()] @ [#:system (%current-system)]
  4251. [#:references-graphs #f] @ [#:allowed-references #f]
  4252. [#:disallowed-references #f] @ [#:leaked-env-vars #f] [#:local-build? #f] @
  4253. [#:substitutable? #t] [#:properties '()] Build a derivation with the given
  4254. arguments, and return the resulting @code{<derivation>} object.
  4255. When @var{hash} and @var{hash-algo} are given, a @dfn{fixed-output
  4256. derivation} is created---i.e., one whose result is known in advance, such as
  4257. a file download. If, in addition, @var{recursive?} is true, then that fixed
  4258. output may be an executable file or a directory and @var{hash} must be the
  4259. hash of an archive containing this output.
  4260. When @var{references-graphs} is true, it must be a list of file name/store
  4261. path pairs. In that case, the reference graph of each store path is
  4262. exported in the build environment in the corresponding file, in a simple
  4263. text format.
  4264. When @var{allowed-references} is true, it must be a list of store items or
  4265. outputs that the derivation's output may refer to. Likewise,
  4266. @var{disallowed-references}, if true, must be a list of things the outputs
  4267. may @emph{not} refer to.
  4268. When @var{leaked-env-vars} is true, it must be a list of strings denoting
  4269. environment variables that are allowed to ``leak'' from the daemon's
  4270. environment to the build environment. This is only applicable to
  4271. fixed-output derivations---i.e., when @var{hash} is true. The main use is
  4272. to allow variables such as @code{http_proxy} to be passed to derivations
  4273. that download files.
  4274. When @var{local-build?} is true, declare that the derivation is not a good
  4275. candidate for offloading and should rather be built locally (@pxref{Auslagern des Daemons einrichten}). This is the case for small derivations where the costs of
  4276. data transfers would outweigh the benefits.
  4277. When @var{substitutable?} is false, declare that substitutes of the
  4278. derivation's output should not be used (@pxref{Substitute}). This is
  4279. useful, for instance, when building packages that capture details of the
  4280. host CPU instruction set.
  4281. @var{properties} must be an association list describing ``properties'' of
  4282. the derivation. It is kept as-is, uninterpreted, in the derivation.
  4283. @end deffn
  4284. @noindent
  4285. Here's an example with a shell script as its builder, assuming @var{store}
  4286. is an open connection to the daemon, and @var{bash} points to a Bash
  4287. executable in the store:
  4288. @lisp
  4289. (use-modules (guix utils)
  4290. (guix store)
  4291. (guix derivations))
  4292. (let ((builder ; add the Bash script to the store
  4293. (add-text-to-store store "my-builder.sh"
  4294. "echo hello world > $out\n" '())))
  4295. (derivation store "foo"
  4296. bash `("-e" ,builder)
  4297. #:inputs `((,bash) (,builder))
  4298. #:env-vars '(("HOME" . "/homeless"))))
  4299. @result{} #<derivation /gnu/store/@dots{}-foo.drv => /gnu/store/@dots{}-foo>
  4300. @end lisp
  4301. As can be guessed, this primitive is cumbersome to use directly. A better
  4302. approach is to write build scripts in Scheme, of course! The best course of
  4303. action for that is to write the build code as a ``G-expression'', and to
  4304. pass it to @code{gexp->derivation}. For more information,
  4305. @pxref{G-Ausdrücke}.
  4306. Once upon a time, @code{gexp->derivation} did not exist and constructing
  4307. derivations with build code written in Scheme was achieved with
  4308. @code{build-expression->derivation}, documented below. This procedure is
  4309. now deprecated in favor of the much nicer @code{gexp->derivation}.
  4310. @deffn {Scheme Procedure} build-expression->derivation @var{store} @
  4311. @var{name} @var{exp} @ [#:system (%current-system)] [#:inputs '()] @
  4312. [#:outputs '("out")] [#:hash #f] [#:hash-algo #f] @ [#:recursive? #f]
  4313. [#:env-vars '()] [#:modules '()] @ [#:references-graphs #f]
  4314. [#:allowed-references #f] @ [#:disallowed-references #f] @ [#:local-build?
  4315. #f] [#:substitutable? #t] [#:guile-for-build #f] Return a derivation that
  4316. executes Scheme expression @var{exp} as a builder for derivation
  4317. @var{name}. @var{inputs} must be a list of @code{(name drv-path sub-drv)}
  4318. tuples; when @var{sub-drv} is omitted, @code{"out"} is assumed.
  4319. @var{modules} is a list of names of Guile modules from the current search
  4320. path to be copied in the store, compiled, and made available in the load
  4321. path during the execution of @var{exp}---e.g., @code{((guix build utils)
  4322. (guix build gnu-build-system))}.
  4323. @var{exp} is evaluated in an environment where @code{%outputs} is bound to a
  4324. list of output/path pairs, and where @code{%build-inputs} is bound to a list
  4325. of string/output-path pairs made from @var{inputs}. Optionally,
  4326. @var{env-vars} is a list of string pairs specifying the name and value of
  4327. environment variables visible to the builder. The builder terminates by
  4328. passing the result of @var{exp} to @code{exit}; thus, when @var{exp} returns
  4329. @code{#f}, the build is considered to have failed.
  4330. @var{exp} is built using @var{guile-for-build} (a derivation). When
  4331. @var{guile-for-build} is omitted or is @code{#f}, the value of the
  4332. @code{%guile-for-build} fluid is used instead.
  4333. See the @code{derivation} procedure for the meaning of
  4334. @var{references-graphs}, @var{allowed-references},
  4335. @var{disallowed-references}, @var{local-build?}, and @var{substitutable?}.
  4336. @end deffn
  4337. @noindent
  4338. Here's an example of a single-output derivation that creates a directory
  4339. containing one file:
  4340. @lisp
  4341. (let ((builder '(let ((out (assoc-ref %outputs "out")))
  4342. (mkdir out) ; create /gnu/store/@dots{}-goo
  4343. (call-with-output-file (string-append out "/test")
  4344. (lambda (p)
  4345. (display '(hello guix) p))))))
  4346. (build-expression->derivation store "goo" builder))
  4347. @result{} #<derivation /gnu/store/@dots{}-goo.drv => @dots{}>
  4348. @end lisp
  4349. @node Die Store-Monade
  4350. @section Die Store-Monade
  4351. @cindex monad
  4352. The procedures that operate on the store described in the previous sections
  4353. all take an open connection to the build daemon as their first argument.
  4354. Although the underlying model is functional, they either have side effects
  4355. or depend on the current state of the store.
  4356. The former is inconvenient: the connection to the build daemon has to be
  4357. carried around in all those functions, making it impossible to compose
  4358. functions that do not take that parameter with functions that do. The
  4359. latter can be problematic: since store operations have side effects and/or
  4360. depend on external state, they have to be properly sequenced.
  4361. @cindex monadic values
  4362. @cindex monadic functions
  4363. This is where the @code{(guix monads)} module comes in. This module
  4364. provides a framework for working with @dfn{monads}, and a particularly
  4365. useful monad for our uses, the @dfn{store monad}. Monads are a construct
  4366. that allows two things: associating ``context'' with values (in our case,
  4367. the context is the store), and building sequences of computations (here
  4368. computations include accesses to the store). Values in a monad---values
  4369. that carry this additional context---are called @dfn{monadic values};
  4370. procedures that return such values are called @dfn{monadic procedures}.
  4371. Consider this ``normal'' procedure:
  4372. @example
  4373. (define (sh-symlink store)
  4374. ;; Return a derivation that symlinks the 'bash' executable.
  4375. (let* ((drv (package-derivation store bash))
  4376. (out (derivation->output-path drv))
  4377. (sh (string-append out "/bin/bash")))
  4378. (build-expression->derivation store "sh"
  4379. `(symlink ,sh %output))))
  4380. @end example
  4381. Using @code{(guix monads)} and @code{(guix gexp)}, it may be rewritten as a
  4382. monadic function:
  4383. @example
  4384. (define (sh-symlink)
  4385. ;; Same, but return a monadic value.
  4386. (mlet %store-monad ((drv (package->derivation bash)))
  4387. (gexp->derivation "sh"
  4388. #~(symlink (string-append #$drv "/bin/bash")
  4389. #$output))))
  4390. @end example
  4391. There are several things to note in the second version: the @code{store}
  4392. parameter is now implicit and is ``threaded'' in the calls to the
  4393. @code{package->derivation} and @code{gexp->derivation} monadic procedures,
  4394. and the monadic value returned by @code{package->derivation} is @dfn{bound}
  4395. using @code{mlet} instead of plain @code{let}.
  4396. As it turns out, the call to @code{package->derivation} can even be omitted
  4397. since it will take place implicitly, as we will see later
  4398. (@pxref{G-Ausdrücke}):
  4399. @example
  4400. (define (sh-symlink)
  4401. (gexp->derivation "sh"
  4402. #~(symlink (string-append #$bash "/bin/bash")
  4403. #$output)))
  4404. @end example
  4405. @c See
  4406. @c <https://syntaxexclamation.wordpress.com/2014/06/26/escaping-continuations/>
  4407. @c for the funny quote.
  4408. Calling the monadic @code{sh-symlink} has no effect. As someone once said,
  4409. ``you exit a monad like you exit a building on fire: by running''. So, to
  4410. exit the monad and get the desired effect, one must use
  4411. @code{run-with-store}:
  4412. @example
  4413. (run-with-store (open-connection) (sh-symlink))
  4414. @result{} /gnu/store/...-sh-symlink
  4415. @end example
  4416. Note that the @code{(guix monad-repl)} module extends the Guile REPL with
  4417. new ``meta-commands'' to make it easier to deal with monadic procedures:
  4418. @code{run-in-store}, and @code{enter-store-monad}. The former is used to
  4419. ``run'' a single monadic value through the store:
  4420. @example
  4421. scheme@@(guile-user)> ,run-in-store (package->derivation hello)
  4422. $1 = #<derivation /gnu/store/@dots{}-hello-2.9.drv => @dots{}>
  4423. @end example
  4424. The latter enters a recursive REPL, where all the return values are
  4425. automatically run through the store:
  4426. @example
  4427. scheme@@(guile-user)> ,enter-store-monad
  4428. store-monad@@(guile-user) [1]> (package->derivation hello)
  4429. $2 = #<derivation /gnu/store/@dots{}-hello-2.9.drv => @dots{}>
  4430. store-monad@@(guile-user) [1]> (text-file "foo" "Hello!")
  4431. $3 = "/gnu/store/@dots{}-foo"
  4432. store-monad@@(guile-user) [1]> ,q
  4433. scheme@@(guile-user)>
  4434. @end example
  4435. @noindent
  4436. Note that non-monadic values cannot be returned in the @code{store-monad}
  4437. REPL.
  4438. The main syntactic forms to deal with monads in general are provided by the
  4439. @code{(guix monads)} module and are described below.
  4440. @deffn {Scheme Syntax} with-monad @var{monad} @var{body} ...
  4441. Evaluate any @code{>>=} or @code{return} forms in @var{body} as being in
  4442. @var{monad}.
  4443. @end deffn
  4444. @deffn {Scheme Syntax} return @var{val}
  4445. Return a monadic value that encapsulates @var{val}.
  4446. @end deffn
  4447. @deffn {Scheme Syntax} >>= @var{mval} @var{mproc} ...
  4448. @dfn{Bind} monadic value @var{mval}, passing its ``contents'' to monadic
  4449. procedures @var{mproc}@dots{}@footnote{This operation is commonly referred
  4450. to as ``bind'', but that name denotes an unrelated procedure in Guile. Thus
  4451. we use this somewhat cryptic symbol inherited from the Haskell language.}.
  4452. There can be one @var{mproc} or several of them, as in this example:
  4453. @example
  4454. (run-with-state
  4455. (with-monad %state-monad
  4456. (>>= (return 1)
  4457. (lambda (x) (return (+ 1 x)))
  4458. (lambda (x) (return (* 2 x)))))
  4459. 'some-state)
  4460. @result{} 4
  4461. @result{} some-state
  4462. @end example
  4463. @end deffn
  4464. @deffn {Scheme Syntax} mlet @var{monad} ((@var{var} @var{mval}) ...) @
  4465. @var{body} ...
  4466. @deffnx {Scheme Syntax} mlet* @var{monad} ((@var{var} @var{mval}) ...) @
  4467. @var{body} ... Bind the variables @var{var} to the monadic values
  4468. @var{mval} in @var{body}, which is a sequence of expressions. As with the
  4469. bind operator, this can be thought of as ``unpacking'' the raw, non-monadic
  4470. value ``contained'' in @var{mval} and making @var{var} refer to that raw,
  4471. non-monadic value within the scope of the @var{body}. The form (@var{var}
  4472. -> @var{val}) binds @var{var} to the ``normal'' value @var{val}, as per
  4473. @code{let}. The binding operations occur in sequence from left to right.
  4474. The last expression of @var{body} must be a monadic expression, and its
  4475. result will become the result of the @code{mlet} or @code{mlet*} when run in
  4476. the @var{monad}.
  4477. @code{mlet*} is to @code{mlet} what @code{let*} is to @code{let}
  4478. (@pxref{Local Bindings,,, guile, GNU Guile Reference Manual}).
  4479. @end deffn
  4480. @deffn {Scheme System} mbegin @var{monad} @var{mexp} ...
  4481. Bind @var{mexp} and the following monadic expressions in sequence, returning
  4482. the result of the last expression. Every expression in the sequence must be
  4483. a monadic expression.
  4484. This is akin to @code{mlet}, except that the return values of the monadic
  4485. expressions are ignored. In that sense, it is analogous to @code{begin},
  4486. but applied to monadic expressions.
  4487. @end deffn
  4488. @deffn {Scheme System} mwhen @var{condition} @var{mexp0} @var{mexp*} ...
  4489. When @var{condition} is true, evaluate the sequence of monadic expressions
  4490. @var{mexp0}..@var{mexp*} as in an @code{mbegin}. When @var{condition} is
  4491. false, return @code{*unspecified*} in the current monad. Every expression
  4492. in the sequence must be a monadic expression.
  4493. @end deffn
  4494. @deffn {Scheme System} munless @var{condition} @var{mexp0} @var{mexp*} ...
  4495. When @var{condition} is false, evaluate the sequence of monadic expressions
  4496. @var{mexp0}..@var{mexp*} as in an @code{mbegin}. When @var{condition} is
  4497. true, return @code{*unspecified*} in the current monad. Every expression in
  4498. the sequence must be a monadic expression.
  4499. @end deffn
  4500. @cindex state monad
  4501. The @code{(guix monads)} module provides the @dfn{state monad}, which allows
  4502. an additional value---the state---to be @emph{threaded} through monadic
  4503. procedure calls.
  4504. @defvr {Scheme Variable} %state-monad
  4505. The state monad. Procedures in the state monad can access and change the
  4506. state that is threaded.
  4507. Consider the example below. The @code{square} procedure returns a value in
  4508. the state monad. It returns the square of its argument, but also increments
  4509. the current state value:
  4510. @example
  4511. (define (square x)
  4512. (mlet %state-monad ((count (current-state)))
  4513. (mbegin %state-monad
  4514. (set-current-state (+ 1 count))
  4515. (return (* x x)))))
  4516. (run-with-state (sequence %state-monad (map square (iota 3))) 0)
  4517. @result{} (0 1 4)
  4518. @result{} 3
  4519. @end example
  4520. When ``run'' through @var{%state-monad}, we obtain that additional state
  4521. value, which is the number of @code{square} calls.
  4522. @end defvr
  4523. @deffn {Monadic Procedure} current-state
  4524. Return the current state as a monadic value.
  4525. @end deffn
  4526. @deffn {Monadic Procedure} set-current-state @var{value}
  4527. Set the current state to @var{value} and return the previous state as a
  4528. monadic value.
  4529. @end deffn
  4530. @deffn {Monadic Procedure} state-push @var{value}
  4531. Push @var{value} to the current state, which is assumed to be a list, and
  4532. return the previous state as a monadic value.
  4533. @end deffn
  4534. @deffn {Monadic Procedure} state-pop
  4535. Pop a value from the current state and return it as a monadic value. The
  4536. state is assumed to be a list.
  4537. @end deffn
  4538. @deffn {Scheme Procedure} run-with-state @var{mval} [@var{state}]
  4539. Run monadic value @var{mval} starting with @var{state} as the initial
  4540. state. Return two values: the resulting value, and the resulting state.
  4541. @end deffn
  4542. The main interface to the store monad, provided by the @code{(guix store)}
  4543. module, is as follows.
  4544. @defvr {Scheme Variable} %store-monad
  4545. The store monad---an alias for @var{%state-monad}.
  4546. Values in the store monad encapsulate accesses to the store. When its
  4547. effect is needed, a value of the store monad must be ``evaluated'' by
  4548. passing it to the @code{run-with-store} procedure (see below.)
  4549. @end defvr
  4550. @deffn {Scheme Procedure} run-with-store @var{store} @var{mval} [#:guile-for-build] [#:system (%current-system)]
  4551. Run @var{mval}, a monadic value in the store monad, in @var{store}, an open
  4552. store connection.
  4553. @end deffn
  4554. @deffn {Monadic Procedure} text-file @var{name} @var{text} [@var{references}]
  4555. Return as a monadic value the absolute file name in the store of the file
  4556. containing @var{text}, a string. @var{references} is a list of store items
  4557. that the resulting text file refers to; it defaults to the empty list.
  4558. @end deffn
  4559. @deffn {Monadic Procedure} binary-file @var{name} @var{data} [@var{references}]
  4560. Return as a monadic value the absolute file name in the store of the file
  4561. containing @var{data}, a bytevector. @var{references} is a list of store
  4562. items that the resulting binary file refers to; it defaults to the empty
  4563. list.
  4564. @end deffn
  4565. @deffn {Monadic Procedure} interned-file @var{file} [@var{name}] @
  4566. [#:recursive? #t] [#:select? (const #t)] Return the name of @var{file} once
  4567. interned in the store. Use @var{name} as its store name, or the basename of
  4568. @var{file} if @var{name} is omitted.
  4569. When @var{recursive?} is true, the contents of @var{file} are added
  4570. recursively; if @var{file} designates a flat file and @var{recursive?} is
  4571. true, its contents are added, and its permission bits are kept.
  4572. When @var{recursive?} is true, call @code{(@var{select?} @var{file}
  4573. @var{stat})} for each directory entry, where @var{file} is the entry's
  4574. absolute file name and @var{stat} is the result of @code{lstat}; exclude
  4575. entries for which @var{select?} does not return true.
  4576. The example below adds a file to the store, under two different names:
  4577. @example
  4578. (run-with-store (open-connection)
  4579. (mlet %store-monad ((a (interned-file "README"))
  4580. (b (interned-file "README" "LEGU-MIN")))
  4581. (return (list a b))))
  4582. @result{} ("/gnu/store/rwm@dots{}-README" "/gnu/store/44i@dots{}-LEGU-MIN")
  4583. @end example
  4584. @end deffn
  4585. The @code{(guix packages)} module exports the following package-related
  4586. monadic procedures:
  4587. @deffn {Monadic Procedure} package-file @var{package} [@var{file}] @
  4588. [#:system (%current-system)] [#:target #f] @ [#:output "out"] Return as a
  4589. monadic value in the absolute file name of @var{file} within the
  4590. @var{output} directory of @var{package}. When @var{file} is omitted, return
  4591. the name of the @var{output} directory of @var{package}. When @var{target}
  4592. is true, use it as a cross-compilation target triplet.
  4593. @end deffn
  4594. @deffn {Monadic Procedure} package->derivation @var{package} [@var{system}]
  4595. @deffnx {Monadic Procedure} package->cross-derivation @var{package} @
  4596. @var{target} [@var{system}] Monadic version of @code{package-derivation} and
  4597. @code{package-cross-derivation} (@pxref{Pakete definieren}).
  4598. @end deffn
  4599. @node G-Ausdrücke
  4600. @section G-Ausdrücke
  4601. @cindex G-expression
  4602. @cindex build code quoting
  4603. So we have ``derivations'', which represent a sequence of build actions to
  4604. be performed to produce an item in the store (@pxref{Ableitungen}). These
  4605. build actions are performed when asking the daemon to actually build the
  4606. derivations; they are run by the daemon in a container (@pxref{Aufruf des guix-daemon}).
  4607. @cindex strata of code
  4608. It should come as no surprise that we like to write these build actions in
  4609. Scheme. When we do that, we end up with two @dfn{strata} of Scheme
  4610. code@footnote{The term @dfn{stratum} in this context was coined by Manuel
  4611. Serrano et al.@: in the context of their work on Hop. Oleg Kiselyov, who
  4612. has written insightful
  4613. @url{http://okmij.org/ftp/meta-programming/#meta-scheme, essays and code on
  4614. this topic}, refers to this kind of code generation as @dfn{staging}.}: the
  4615. ``host code''---code that defines packages, talks to the daemon, etc.---and
  4616. the ``build code''---code that actually performs build actions, such as
  4617. making directories, invoking @command{make}, etc.
  4618. To describe a derivation and its build actions, one typically needs to embed
  4619. build code inside host code. It boils down to manipulating build code as
  4620. data, and the homoiconicity of Scheme---code has a direct representation as
  4621. data---comes in handy for that. But we need more than the normal
  4622. @code{quasiquote} mechanism in Scheme to construct build expressions.
  4623. The @code{(guix gexp)} module implements @dfn{G-expressions}, a form of
  4624. S-expressions adapted to build expressions. G-expressions, or @dfn{gexps},
  4625. consist essentially of three syntactic forms: @code{gexp}, @code{ungexp},
  4626. and @code{ungexp-splicing} (or simply: @code{#~}, @code{#$}, and
  4627. @code{#$@@}), which are comparable to @code{quasiquote}, @code{unquote}, and
  4628. @code{unquote-splicing}, respectively (@pxref{Expression Syntax,
  4629. @code{quasiquote},, guile, GNU Guile Reference Manual}). However, there are
  4630. major differences:
  4631. @itemize
  4632. @item
  4633. Gexps are meant to be written to a file and run or manipulated by other
  4634. processes.
  4635. @item
  4636. When a high-level object such as a package or derivation is unquoted inside
  4637. a gexp, the result is as if its output file name had been introduced.
  4638. @item
  4639. Gexps carry information about the packages or derivations they refer to, and
  4640. these dependencies are automatically added as inputs to the build processes
  4641. that use them.
  4642. @end itemize
  4643. @cindex lowering, of high-level objects in gexps
  4644. This mechanism is not limited to package and derivation objects:
  4645. @dfn{compilers} able to ``lower'' other high-level objects to derivations or
  4646. files in the store can be defined, such that these objects can also be
  4647. inserted into gexps. For example, a useful type of high-level objects that
  4648. can be inserted in a gexp is ``file-like objects'', which make it easy to
  4649. add files to the store and to refer to them in derivations and such (see
  4650. @code{local-file} and @code{plain-file} below.)
  4651. To illustrate the idea, here is an example of a gexp:
  4652. @example
  4653. (define build-exp
  4654. #~(begin
  4655. (mkdir #$output)
  4656. (chdir #$output)
  4657. (symlink (string-append #$coreutils "/bin/ls")
  4658. "list-files")))
  4659. @end example
  4660. This gexp can be passed to @code{gexp->derivation}; we obtain a derivation
  4661. that builds a directory containing exactly one symlink to
  4662. @file{/gnu/store/@dots{}-coreutils-8.22/bin/ls}:
  4663. @example
  4664. (gexp->derivation "the-thing" build-exp)
  4665. @end example
  4666. As one would expect, the @code{"/gnu/store/@dots{}-coreutils-8.22"} string
  4667. is substituted to the reference to the @var{coreutils} package in the actual
  4668. build code, and @var{coreutils} is automatically made an input to the
  4669. derivation. Likewise, @code{#$output} (equivalent to @code{(ungexp
  4670. output)}) is replaced by a string containing the directory name of the
  4671. output of the derivation.
  4672. @cindex cross compilation
  4673. In a cross-compilation context, it is useful to distinguish between
  4674. references to the @emph{native} build of a package---that can run on the
  4675. host---versus references to cross builds of a package. To that end, the
  4676. @code{#+} plays the same role as @code{#$}, but is a reference to a native
  4677. package build:
  4678. @example
  4679. (gexp->derivation "vi"
  4680. #~(begin
  4681. (mkdir #$output)
  4682. (system* (string-append #+coreutils "/bin/ln")
  4683. "-s"
  4684. (string-append #$emacs "/bin/emacs")
  4685. (string-append #$output "/bin/vi")))
  4686. #:target "mips64el-linux-gnu")
  4687. @end example
  4688. @noindent
  4689. In the example above, the native build of @var{coreutils} is used, so that
  4690. @command{ln} can actually run on the host; but then the cross-compiled build
  4691. of @var{emacs} is referenced.
  4692. @cindex imported modules, for gexps
  4693. @findex with-imported-modules
  4694. Another gexp feature is @dfn{imported modules}: sometimes you want to be
  4695. able to use certain Guile modules from the ``host environment'' in the gexp,
  4696. so those modules should be imported in the ``build environment''. The
  4697. @code{with-imported-modules} form allows you to express that:
  4698. @example
  4699. (let ((build (with-imported-modules '((guix build utils))
  4700. #~(begin
  4701. (use-modules (guix build utils))
  4702. (mkdir-p (string-append #$output "/bin"))))))
  4703. (gexp->derivation "empty-dir"
  4704. #~(begin
  4705. #$build
  4706. (display "success!\n")
  4707. #t)))
  4708. @end example
  4709. @noindent
  4710. In this example, the @code{(guix build utils)} module is automatically
  4711. pulled into the isolated build environment of our gexp, such that
  4712. @code{(use-modules (guix build utils))} works as expected.
  4713. @cindex module closure
  4714. @findex source-module-closure
  4715. Usually you want the @emph{closure} of the module to be imported---i.e., the
  4716. module itself and all the modules it depends on---rather than just the
  4717. module; failing to do that, attempts to use the module will fail because of
  4718. missing dependent modules. The @code{source-module-closure} procedure
  4719. computes the closure of a module by looking at its source file headers,
  4720. which comes in handy in this case:
  4721. @example
  4722. (use-modules (guix modules)) ;for 'source-module-closure'
  4723. (with-imported-modules (source-module-closure
  4724. '((guix build utils)
  4725. (gnu build vm)))
  4726. (gexp->derivation "something-with-vms"
  4727. #~(begin
  4728. (use-modules (guix build utils)
  4729. (gnu build vm))
  4730. @dots{})))
  4731. @end example
  4732. @cindex extensions, for gexps
  4733. @findex with-extensions
  4734. In the same vein, sometimes you want to import not just pure-Scheme modules,
  4735. but also ``extensions'' such as Guile bindings to C libraries or other
  4736. ``full-blown'' packages. Say you need the @code{guile-json} package
  4737. available on the build side, here's how you would do it:
  4738. @example
  4739. (use-modules (gnu packages guile)) ;for 'guile-json'
  4740. (with-extensions (list guile-json)
  4741. (gexp->derivation "something-with-json"
  4742. #~(begin
  4743. (use-modules (json))
  4744. @dots{})))
  4745. @end example
  4746. The syntactic form to construct gexps is summarized below.
  4747. @deffn {Scheme Syntax} #~@var{exp}
  4748. @deffnx {Scheme Syntax} (gexp @var{exp})
  4749. Return a G-expression containing @var{exp}. @var{exp} may contain one or
  4750. more of the following forms:
  4751. @table @code
  4752. @item #$@var{obj}
  4753. @itemx (ungexp @var{obj})
  4754. Introduce a reference to @var{obj}. @var{obj} may have one of the supported
  4755. types, for example a package or a derivation, in which case the
  4756. @code{ungexp} form is replaced by its output file name---e.g.,
  4757. @code{"/gnu/store/@dots{}-coreutils-8.22}.
  4758. If @var{obj} is a list, it is traversed and references to supported objects
  4759. are substituted similarly.
  4760. If @var{obj} is another gexp, its contents are inserted and its dependencies
  4761. are added to those of the containing gexp.
  4762. If @var{obj} is another kind of object, it is inserted as is.
  4763. @item #$@var{obj}:@var{output}
  4764. @itemx (ungexp @var{obj} @var{output})
  4765. This is like the form above, but referring explicitly to the @var{output} of
  4766. @var{obj}---this is useful when @var{obj} produces multiple outputs
  4767. (@pxref{Pakete mit mehreren Ausgaben.}).
  4768. @item #+@var{obj}
  4769. @itemx #+@var{obj}:output
  4770. @itemx (ungexp-native @var{obj})
  4771. @itemx (ungexp-native @var{obj} @var{output})
  4772. Same as @code{ungexp}, but produces a reference to the @emph{native} build
  4773. of @var{obj} when used in a cross compilation context.
  4774. @item #$output[:@var{output}]
  4775. @itemx (ungexp output [@var{output}])
  4776. Insert a reference to derivation output @var{output}, or to the main output
  4777. when @var{output} is omitted.
  4778. This only makes sense for gexps passed to @code{gexp->derivation}.
  4779. @item #$@@@var{lst}
  4780. @itemx (ungexp-splicing @var{lst})
  4781. Like the above, but splices the contents of @var{lst} inside the containing
  4782. list.
  4783. @item #+@@@var{lst}
  4784. @itemx (ungexp-native-splicing @var{lst})
  4785. Like the above, but refers to native builds of the objects listed in
  4786. @var{lst}.
  4787. @end table
  4788. G-expressions created by @code{gexp} or @code{#~} are run-time objects of
  4789. the @code{gexp?} type (see below.)
  4790. @end deffn
  4791. @deffn {Scheme Syntax} with-imported-modules @var{modules} @var{body}@dots{}
  4792. Mark the gexps defined in @var{body}@dots{} as requiring @var{modules} in
  4793. their execution environment.
  4794. Each item in @var{modules} can be the name of a module, such as @code{(guix
  4795. build utils)}, or it can be a module name, followed by an arrow, followed by
  4796. a file-like object:
  4797. @example
  4798. `((guix build utils)
  4799. (guix gcrypt)
  4800. ((guix config) => ,(scheme-file "config.scm"
  4801. #~(define-module @dots{}))))
  4802. @end example
  4803. @noindent
  4804. In the example above, the first two modules are taken from the search path,
  4805. and the last one is created from the given file-like object.
  4806. This form has @emph{lexical} scope: it has an effect on the gexps directly
  4807. defined in @var{body}@dots{}, but not on those defined, say, in procedures
  4808. called from @var{body}@dots{}.
  4809. @end deffn
  4810. @deffn {Scheme Syntax} with-extensions @var{extensions} @var{body}@dots{}
  4811. Mark the gexps defined in @var{body}@dots{} as requiring @var{extensions} in
  4812. their build and execution environment. @var{extensions} is typically a list
  4813. of package objects such as those defined in the @code{(gnu packages guile)}
  4814. module.
  4815. Concretely, the packages listed in @var{extensions} are added to the load
  4816. path while compiling imported modules in @var{body}@dots{}; they are also
  4817. added to the load path of the gexp returned by @var{body}@dots{}.
  4818. @end deffn
  4819. @deffn {Scheme Procedure} gexp? @var{obj}
  4820. Return @code{#t} if @var{obj} is a G-expression.
  4821. @end deffn
  4822. G-expressions are meant to be written to disk, either as code building some
  4823. derivation, or as plain files in the store. The monadic procedures below
  4824. allow you to do that (@pxref{Die Store-Monade}, for more information about
  4825. monads.)
  4826. @deffn {Monadic Procedure} gexp->derivation @var{name} @var{exp} @
  4827. [#:system (%current-system)] [#:target #f] [#:graft? #t] @ [#:hash #f]
  4828. [#:hash-algo #f] @ [#:recursive? #f] [#:env-vars '()] [#:modules '()] @
  4829. [#:module-path @var{%load-path}] @ [#:effective-version "2.2"] @
  4830. [#:references-graphs #f] [#:allowed-references #f] @
  4831. [#:disallowed-references #f] @ [#:leaked-env-vars #f] @ [#:script-name
  4832. (string-append @var{name} "-builder")] @ [#:deprecation-warnings #f] @
  4833. [#:local-build? #f] [#:substitutable? #t] @ [#:properties '()]
  4834. [#:guile-for-build #f] Return a derivation @var{name} that runs @var{exp} (a
  4835. gexp) with @var{guile-for-build} (a derivation) on @var{system}; @var{exp}
  4836. is stored in a file called @var{script-name}. When @var{target} is true, it
  4837. is used as the cross-compilation target triplet for packages referred to by
  4838. @var{exp}.
  4839. @var{modules} is deprecated in favor of @code{with-imported-modules}. Its
  4840. meaning is to make @var{modules} available in the evaluation context of
  4841. @var{exp}; @var{modules} is a list of names of Guile modules searched in
  4842. @var{module-path} to be copied in the store, compiled, and made available in
  4843. the load path during the execution of @var{exp}---e.g., @code{((guix build
  4844. utils) (guix build gnu-build-system))}.
  4845. @var{effective-version} determines the string to use when adding extensions
  4846. of @var{exp} (see @code{with-extensions}) to the search path---e.g.,
  4847. @code{"2.2"}.
  4848. @var{graft?} determines whether packages referred to by @var{exp} should be
  4849. grafted when applicable.
  4850. When @var{references-graphs} is true, it must be a list of tuples of one of
  4851. the following forms:
  4852. @example
  4853. (@var{file-name} @var{package})
  4854. (@var{file-name} @var{package} @var{output})
  4855. (@var{file-name} @var{derivation})
  4856. (@var{file-name} @var{derivation} @var{output})
  4857. (@var{file-name} @var{store-item})
  4858. @end example
  4859. The right-hand-side of each element of @var{references-graphs} is
  4860. automatically made an input of the build process of @var{exp}. In the build
  4861. environment, each @var{file-name} contains the reference graph of the
  4862. corresponding item, in a simple text format.
  4863. @var{allowed-references} must be either @code{#f} or a list of output names
  4864. and packages. In the latter case, the list denotes store items that the
  4865. result is allowed to refer to. Any reference to another store item will
  4866. lead to a build error. Similarly for @var{disallowed-references}, which can
  4867. list items that must not be referenced by the outputs.
  4868. @var{deprecation-warnings} determines whether to show deprecation warnings
  4869. while compiling modules. It can be @code{#f}, @code{#t}, or
  4870. @code{'detailed}.
  4871. The other arguments are as for @code{derivation} (@pxref{Ableitungen}).
  4872. @end deffn
  4873. @cindex file-like objects
  4874. The @code{local-file}, @code{plain-file}, @code{computed-file},
  4875. @code{program-file}, and @code{scheme-file} procedures below return
  4876. @dfn{file-like objects}. That is, when unquoted in a G-expression, these
  4877. objects lead to a file in the store. Consider this G-expression:
  4878. @example
  4879. #~(system* #$(file-append glibc "/sbin/nscd") "-f"
  4880. #$(local-file "/tmp/my-nscd.conf"))
  4881. @end example
  4882. The effect here is to ``intern'' @file{/tmp/my-nscd.conf} by copying it to
  4883. the store. Once expanded, for instance @i{via} @code{gexp->derivation}, the
  4884. G-expression refers to that copy under @file{/gnu/store}; thus, modifying or
  4885. removing the file in @file{/tmp} does not have any effect on what the
  4886. G-expression does. @code{plain-file} can be used similarly; it differs in
  4887. that the file content is directly passed as a string.
  4888. @deffn {Scheme Procedure} local-file @var{file} [@var{name}] @
  4889. [#:recursive? #f] [#:select? (const #t)] Return an object representing local
  4890. file @var{file} to add to the store; this object can be used in a gexp. If
  4891. @var{file} is a relative file name, it is looked up relative to the source
  4892. file where this form appears. @var{file} will be added to the store under
  4893. @var{name}--by default the base name of @var{file}.
  4894. When @var{recursive?} is true, the contents of @var{file} are added
  4895. recursively; if @var{file} designates a flat file and @var{recursive?} is
  4896. true, its contents are added, and its permission bits are kept.
  4897. When @var{recursive?} is true, call @code{(@var{select?} @var{file}
  4898. @var{stat})} for each directory entry, where @var{file} is the entry's
  4899. absolute file name and @var{stat} is the result of @code{lstat}; exclude
  4900. entries for which @var{select?} does not return true.
  4901. This is the declarative counterpart of the @code{interned-file} monadic
  4902. procedure (@pxref{Die Store-Monade, @code{interned-file}}).
  4903. @end deffn
  4904. @deffn {Scheme Procedure} plain-file @var{name} @var{content}
  4905. Return an object representing a text file called @var{name} with the given
  4906. @var{content} (a string or a bytevector) to be added to the store.
  4907. This is the declarative counterpart of @code{text-file}.
  4908. @end deffn
  4909. @deffn {Scheme Procedure} computed-file @var{name} @var{gexp} @
  4910. [#:options '(#:local-build? #t)] Return an object representing the store
  4911. item @var{name}, a file or directory computed by @var{gexp}. @var{options}
  4912. is a list of additional arguments to pass to @code{gexp->derivation}.
  4913. This is the declarative counterpart of @code{gexp->derivation}.
  4914. @end deffn
  4915. @deffn {Monadic Procedure} gexp->script @var{name} @var{exp} @
  4916. [#:guile (default-guile)] [#:module-path %load-path] Return an executable
  4917. script @var{name} that runs @var{exp} using @var{guile}, with @var{exp}'s
  4918. imported modules in its search path. Look up @var{exp}'s modules in
  4919. @var{module-path}.
  4920. The example below builds a script that simply invokes the @command{ls}
  4921. command:
  4922. @example
  4923. (use-modules (guix gexp) (gnu packages base))
  4924. (gexp->script "list-files"
  4925. #~(execl #$(file-append coreutils "/bin/ls")
  4926. "ls"))
  4927. @end example
  4928. When ``running'' it through the store (@pxref{Die Store-Monade,
  4929. @code{run-with-store}}), we obtain a derivation that produces an executable
  4930. file @file{/gnu/store/@dots{}-list-files} along these lines:
  4931. @example
  4932. #!/gnu/store/@dots{}-guile-2.0.11/bin/guile -ds
  4933. !#
  4934. (execl "/gnu/store/@dots{}-coreutils-8.22"/bin/ls" "ls")
  4935. @end example
  4936. @end deffn
  4937. @deffn {Scheme Procedure} program-file @var{name} @var{exp} @
  4938. [#:guile #f] [#:module-path %load-path] Return an object representing the
  4939. executable store item @var{name} that runs @var{gexp}. @var{guile} is the
  4940. Guile package used to execute that script. Imported modules of @var{gexp}
  4941. are looked up in @var{module-path}.
  4942. This is the declarative counterpart of @code{gexp->script}.
  4943. @end deffn
  4944. @deffn {Monadic Procedure} gexp->file @var{name} @var{exp} @
  4945. [#:set-load-path? #t] [#:module-path %load-path] @ [#:splice? #f] @ [#:guile
  4946. (default-guile)] Return a derivation that builds a file @var{name}
  4947. containing @var{exp}. When @var{splice?} is true, @var{exp} is considered
  4948. to be a list of expressions that will be spliced in the resulting file.
  4949. When @var{set-load-path?} is true, emit code in the resulting file to set
  4950. @code{%load-path} and @code{%load-compiled-path} to honor @var{exp}'s
  4951. imported modules. Look up @var{exp}'s modules in @var{module-path}.
  4952. The resulting file holds references to all the dependencies of @var{exp} or
  4953. a subset thereof.
  4954. @end deffn
  4955. @deffn {Scheme Procedure} scheme-file @var{name} @var{exp} [#:splice? #f]
  4956. Return an object representing the Scheme file @var{name} that contains
  4957. @var{exp}.
  4958. This is the declarative counterpart of @code{gexp->file}.
  4959. @end deffn
  4960. @deffn {Monadic Procedure} text-file* @var{name} @var{text} @dots{}
  4961. Return as a monadic value a derivation that builds a text file containing
  4962. all of @var{text}. @var{text} may list, in addition to strings, objects of
  4963. any type that can be used in a gexp: packages, derivations, local file
  4964. objects, etc. The resulting store file holds references to all these.
  4965. This variant should be preferred over @code{text-file} anytime the file to
  4966. create will reference items from the store. This is typically the case when
  4967. building a configuration file that embeds store file names, like this:
  4968. @example
  4969. (define (profile.sh)
  4970. ;; Return the name of a shell script in the store that
  4971. ;; initializes the 'PATH' environment variable.
  4972. (text-file* "profile.sh"
  4973. "export PATH=" coreutils "/bin:"
  4974. grep "/bin:" sed "/bin\n"))
  4975. @end example
  4976. In this example, the resulting @file{/gnu/store/@dots{}-profile.sh} file
  4977. will reference @var{coreutils}, @var{grep}, and @var{sed}, thereby
  4978. preventing them from being garbage-collected during its lifetime.
  4979. @end deffn
  4980. @deffn {Scheme Procedure} mixed-text-file @var{name} @var{text} @dots{}
  4981. Return an object representing store file @var{name} containing @var{text}.
  4982. @var{text} is a sequence of strings and file-like objects, as in:
  4983. @example
  4984. (mixed-text-file "profile"
  4985. "export PATH=" coreutils "/bin:" grep "/bin")
  4986. @end example
  4987. This is the declarative counterpart of @code{text-file*}.
  4988. @end deffn
  4989. @deffn {Scheme Procedure} file-union @var{name} @var{files}
  4990. Return a @code{<computed-file>} that builds a directory containing all of
  4991. @var{files}. Each item in @var{files} must be a two-element list where the
  4992. first element is the file name to use in the new directory, and the second
  4993. element is a gexp denoting the target file. Here's an example:
  4994. @example
  4995. (file-union "etc"
  4996. `(("hosts" ,(plain-file "hosts"
  4997. "127.0.0.1 localhost"))
  4998. ("bashrc" ,(plain-file "bashrc"
  4999. "alias ls='ls --color=auto'"))))
  5000. @end example
  5001. This yields an @code{etc} directory containing these two files.
  5002. @end deffn
  5003. @deffn {Scheme Procedure} directory-union @var{name} @var{things}
  5004. Return a directory that is the union of @var{things}, where @var{things} is
  5005. a list of file-like objects denoting directories. For example:
  5006. @example
  5007. (directory-union "guile+emacs" (list guile emacs))
  5008. @end example
  5009. yields a directory that is the union of the @code{guile} and @code{emacs}
  5010. packages.
  5011. @end deffn
  5012. @deffn {Scheme Procedure} file-append @var{obj} @var{suffix} @dots{}
  5013. Return a file-like object that expands to the concatenation of @var{obj} and
  5014. @var{suffix}, where @var{obj} is a lowerable object and each @var{suffix} is
  5015. a string.
  5016. As an example, consider this gexp:
  5017. @example
  5018. (gexp->script "run-uname"
  5019. #~(system* #$(file-append coreutils
  5020. "/bin/uname")))
  5021. @end example
  5022. The same effect could be achieved with:
  5023. @example
  5024. (gexp->script "run-uname"
  5025. #~(system* (string-append #$coreutils
  5026. "/bin/uname")))
  5027. @end example
  5028. There is one difference though: in the @code{file-append} case, the
  5029. resulting script contains the absolute file name as a string, whereas in the
  5030. second case, the resulting script contains a @code{(string-append @dots{})}
  5031. expression to construct the file name @emph{at run time}.
  5032. @end deffn
  5033. Of course, in addition to gexps embedded in ``host'' code, there are also
  5034. modules containing build tools. To make it clear that they are meant to be
  5035. used in the build stratum, these modules are kept in the @code{(guix build
  5036. @dots{})} name space.
  5037. @cindex lowering, of high-level objects in gexps
  5038. Internally, high-level objects are @dfn{lowered}, using their compiler, to
  5039. either derivations or store items. For instance, lowering a package yields
  5040. a derivation, and lowering a @code{plain-file} yields a store item. This is
  5041. achieved using the @code{lower-object} monadic procedure.
  5042. @deffn {Monadic Procedure} lower-object @var{obj} [@var{system}] @
  5043. [#:target #f] Return as a value in @var{%store-monad} the derivation or
  5044. store item corresponding to @var{obj} for @var{system}, cross-compiling for
  5045. @var{target} if @var{target} is true. @var{obj} must be an object that has
  5046. an associated gexp compiler, such as a @code{<package>}.
  5047. @end deffn
  5048. @node Invoking guix repl
  5049. @section Invoking @command{guix repl}
  5050. @cindex REPL, read-eval-print loop
  5051. The @command{guix repl} command spawns a Guile @dfn{read-eval-print loop}
  5052. (REPL) for interactive programming (@pxref{Using Guile Interactively,,,
  5053. guile, GNU Guile Reference Manual}). Compared to just launching the
  5054. @command{guile} command, @command{guix repl} guarantees that all the Guix
  5055. modules and all its dependencies are available in the search path. You can
  5056. use it this way:
  5057. @example
  5058. $ guix repl
  5059. scheme@@(guile-user)> ,use (gnu packages base)
  5060. scheme@@(guile-user)> coreutils
  5061. $1 = #<package coreutils@@8.29 gnu/packages/base.scm:327 3e28300>
  5062. @end example
  5063. @cindex inferiors
  5064. In addition, @command{guix repl} implements a simple machine-readable REPL
  5065. protocol for use by @code{(guix inferior)}, a facility to interact with
  5066. @dfn{inferiors}, separate processes running a potentially different revision
  5067. of Guix.
  5068. The available options are as follows:
  5069. @table @code
  5070. @item --type=@var{type}
  5071. @itemx -t @var{type}
  5072. Start a REPL of the given @var{TYPE}, which can be one of the following:
  5073. @table @code
  5074. @item guile
  5075. This is default, and it spawns a standard full-featured Guile REPL.
  5076. @item machine
  5077. Spawn a REPL that uses the machine-readable protocol. This is the protocol
  5078. that the @code{(guix inferior)} module speaks.
  5079. @end table
  5080. @item --listen=@var{Endpunkt}
  5081. By default, @command{guix repl} reads from standard input and writes to
  5082. standard output. When this option is passed, it will instead listen for
  5083. connections on @var{endpoint}. Here are examples of valid options:
  5084. @table @code
  5085. @item --listen=tcp:37146
  5086. Accept connections on localhost on port 37146.
  5087. @item --listen=unix:/tmp/socket
  5088. Accept connections on the Unix-domain socket @file{/tmp/socket}.
  5089. @end table
  5090. @end table
  5091. @c *********************************************************************
  5092. @node Zubehör
  5093. @chapter Zubehör
  5094. This section describes Guix command-line utilities. Some of them are
  5095. primarily targeted at developers and users who write new package
  5096. definitions, while others are more generally useful. They complement the
  5097. Scheme programming interface of Guix in a convenient way.
  5098. @menu
  5099. * Aufruf von guix build:: Pakete aus der Befehlszeile heraus erstellen.
  5100. * Aufruf von guix edit:: Paketdefinitionen bearbeiten.
  5101. * Aufruf von guix download:: Herunterladen einer Datei und Ausgabe ihres
  5102. Hashes.
  5103. * Aufruf von guix hash:: Den kryptographischen Hash einer Datei
  5104. berechnen.
  5105. * Aufruf von guix import:: Paketdefinitionen importieren.
  5106. * Aufruf von guix refresh:: Paketdefinitionen aktualisieren.
  5107. * Aufruf von guix lint:: Fehler in Paketdefinitionen finden.
  5108. * Aufruf von guix size:: Plattenverbrauch profilieren.
  5109. * Aufruf von guix graph:: Den Paketgraphen visualisieren.
  5110. * Aufruf von guix environment:: Entwicklungsumgebungen einrichten.
  5111. * Aufruf von guix publish:: Substitute teilen.
  5112. * Aufruf von guix challenge:: Die Substitut-Server anfechten.
  5113. * Aufruf von guix copy:: Mit einem entfernten Store Dateien austauschen.
  5114. * Aufruf von guix container:: Prozesse isolieren.
  5115. * Aufruf von guix weather:: Die Verfügbarkeit von Substituten
  5116. einschätzen.
  5117. * Invoking guix processes:: Listing client processes.
  5118. @end menu
  5119. @node Aufruf von guix build
  5120. @section Aufruf von @command{guix build}
  5121. @cindex package building
  5122. @cindex @command{guix build}
  5123. The @command{guix build} command builds packages or derivations and their
  5124. dependencies, and prints the resulting store paths. Note that it does not
  5125. modify the user's profile---this is the job of the @command{guix package}
  5126. command (@pxref{Aufruf von guix package}). Thus, it is mainly useful for
  5127. distribution developers.
  5128. The general syntax is:
  5129. @example
  5130. guix build @var{options} @var{package-or-derivation}@dots{}
  5131. @end example
  5132. As an example, the following command builds the latest versions of Emacs and
  5133. of Guile, displays their build logs, and finally displays the resulting
  5134. directories:
  5135. @example
  5136. guix build emacs guile
  5137. @end example
  5138. Similarly, the following command builds all the available packages:
  5139. @example
  5140. guix build --quiet --keep-going \
  5141. `guix package -A | cut -f1,2 --output-delimiter=@@`
  5142. @end example
  5143. @var{package-or-derivation} may be either the name of a package found in the
  5144. software distribution such as @code{coreutils} or @code{coreutils@@8.20}, or
  5145. a derivation such as @file{/gnu/store/@dots{}-coreutils-8.19.drv}. In the
  5146. former case, a package with the corresponding name (and optionally version)
  5147. is searched for among the GNU distribution modules (@pxref{Paketmodule}).
  5148. Alternatively, the @code{--expression} option may be used to specify a
  5149. Scheme expression that evaluates to a package; this is useful when
  5150. disambiguating among several same-named packages or package variants is
  5151. needed.
  5152. There may be zero or more @var{options}. The available options are
  5153. described in the subsections below.
  5154. @menu
  5155. * Gemeinsame Erstellungsoptionen:: Erstellungsoptionen für die meisten
  5156. Befehle.
  5157. * Paketumwandlungsoptionen:: Varianten von Paketen erzeugen.
  5158. * Zusätzliche Erstellungsoptionen:: Optionen spezifisch für »guix
  5159. build«.
  5160. * Fehlschläge beim Erstellen untersuchen:: Praxiserfahrung bei der
  5161. Paketerstellung.
  5162. @end menu
  5163. @node Gemeinsame Erstellungsoptionen
  5164. @subsection Gemeinsame Erstellungsoptionen
  5165. A number of options that control the build process are common to
  5166. @command{guix build} and other commands that can spawn builds, such as
  5167. @command{guix package} or @command{guix archive}. These are the following:
  5168. @table @code
  5169. @item --load-path=@var{directory}
  5170. @itemx -L @var{directory}
  5171. Add @var{directory} to the front of the package module search path
  5172. (@pxref{Paketmodule}).
  5173. This allows users to define their own packages and make them visible to the
  5174. command-line tools.
  5175. @item --keep-failed
  5176. @itemx -K
  5177. Keep the build tree of failed builds. Thus, if a build fails, its build
  5178. tree is kept under @file{/tmp}, in a directory whose name is shown at the
  5179. end of the build log. This is useful when debugging build issues.
  5180. @xref{Fehlschläge beim Erstellen untersuchen}, for tips and tricks on how to debug build
  5181. issues.
  5182. This option has no effect when connecting to a remote daemon with a
  5183. @code{guix://} URI (@pxref{Der Store, the @code{GUIX_DAEMON_SOCKET}
  5184. variable}).
  5185. @item --keep-going
  5186. @itemx -k
  5187. Keep going when some of the derivations fail to build; return only once all
  5188. the builds have either completed or failed.
  5189. The default behavior is to stop as soon as one of the specified derivations
  5190. has failed.
  5191. @item --dry-run
  5192. @itemx -n
  5193. Do not build the derivations.
  5194. @anchor{fallback-option}
  5195. @item --fallback
  5196. When substituting a pre-built binary fails, fall back to building packages
  5197. locally (@pxref{Fehler bei der Substitution}).
  5198. @item --substitute-urls=@var{URLs}
  5199. @anchor{client-substitute-urls}
  5200. Consider @var{urls} the whitespace-separated list of substitute source URLs,
  5201. overriding the default list of URLs of @command{guix-daemon}
  5202. (@pxref{daemon-substitute-urls,, @command{guix-daemon} URLs}).
  5203. This means that substitutes may be downloaded from @var{urls}, provided they
  5204. are signed by a key authorized by the system administrator
  5205. (@pxref{Substitute}).
  5206. When @var{urls} is the empty string, substitutes are effectively disabled.
  5207. @item --no-substitutes
  5208. Benutze keine Substitute für Erstellungsergebnisse. Das heißt, dass alle
  5209. Objekte lokal erstellt werden müssen, und kein Herunterladen von vorab
  5210. erstellten Binärdateien erlaubt ist (@pxref{Substitute}).
  5211. @item --no-grafts
  5212. Do not ``graft'' packages. In practice, this means that package updates
  5213. available as grafts are not applied. @xref{Sicherheitsaktualisierungen}, for more
  5214. information on grafts.
  5215. @item --rounds=@var{n}
  5216. Build each derivation @var{n} times in a row, and raise an error if
  5217. consecutive build results are not bit-for-bit identical.
  5218. This is a useful way to detect non-deterministic builds processes.
  5219. Non-deterministic build processes are a problem because they make it
  5220. practically impossible for users to @emph{verify} whether third-party
  5221. binaries are genuine. @xref{Aufruf von guix challenge}, for more.
  5222. Note that, currently, the differing build results are not kept around, so
  5223. you will have to manually investigate in case of an error---e.g., by
  5224. stashing one of the build results with @code{guix archive --export}
  5225. (@pxref{Aufruf von guix archive}), then rebuilding, and finally comparing the
  5226. two results.
  5227. @item --no-build-hook
  5228. Nicht versuchen, Erstellungen über den »Build-Hook« des Daemons auszulagern
  5229. (@pxref{Auslagern des Daemons einrichten}). Somit wird lokal erstellt, statt
  5230. Erstellungen auf entfernte Maschinen auszulagern.
  5231. @item --max-silent-time=@var{Sekunden}
  5232. Wenn der Erstellungs- oder Substitutionsprozess länger als
  5233. @var{Sekunden}-lang keine Ausgabe erzeugt, wird er abgebrochen und ein
  5234. Fehler beim Erstellen gemeldet.
  5235. By default, the daemon's setting is honored (@pxref{Aufruf des guix-daemon,
  5236. @code{--max-silent-time}}).
  5237. @item --timeout=@var{Sekunden}
  5238. Entsprechend wird hier der Erstellungs- oder Substitutionsprozess
  5239. abgebrochen und als Fehlschlag gemeldet, wenn er mehr als
  5240. @var{Sekunden}-lang dauert.
  5241. By default, the daemon's setting is honored (@pxref{Aufruf des guix-daemon,
  5242. @code{--timeout}}).
  5243. @item --verbosity=@var{level}
  5244. Use the given verbosity level. @var{level} must be an integer between 0 and
  5245. 5; higher means more verbose output. Setting a level of 4 or more may be
  5246. helpful when debugging setup issues with the build daemon.
  5247. @item --cores=@var{n}
  5248. @itemx -c @var{n}
  5249. Allow the use of up to @var{n} CPU cores for the build. The special value
  5250. @code{0} means to use as many CPU cores as available.
  5251. @item --max-jobs=@var{n}
  5252. @itemx -M @var{n}
  5253. Allow at most @var{n} build jobs in parallel. @xref{Aufruf des guix-daemon,
  5254. @code{--max-jobs}}, for details about this option and the equivalent
  5255. @command{guix-daemon} option.
  5256. @end table
  5257. Behind the scenes, @command{guix build} is essentially an interface to the
  5258. @code{package-derivation} procedure of the @code{(guix packages)} module,
  5259. and to the @code{build-derivations} procedure of the @code{(guix
  5260. derivations)} module.
  5261. In addition to options explicitly passed on the command line, @command{guix
  5262. build} and other @command{guix} commands that support building honor the
  5263. @code{GUIX_BUILD_OPTIONS} environment variable.
  5264. @defvr {Environment Variable} GUIX_BUILD_OPTIONS
  5265. Users can define this variable to a list of command line options that will
  5266. automatically be used by @command{guix build} and other @command{guix}
  5267. commands that can perform builds, as in the example below:
  5268. @example
  5269. $ export GUIX_BUILD_OPTIONS="--no-substitutes -c 2 -L /foo/bar"
  5270. @end example
  5271. These options are parsed independently, and the result is appended to the
  5272. parsed command-line options.
  5273. @end defvr
  5274. @node Paketumwandlungsoptionen
  5275. @subsection Paketumwandlungsoptionen
  5276. @cindex package variants
  5277. Another set of command-line options supported by @command{guix build} and
  5278. also @command{guix package} are @dfn{package transformation options}. These
  5279. are options that make it possible to define @dfn{package variants}---for
  5280. instance, packages built from different source code. This is a convenient
  5281. way to create customized packages on the fly without having to type in the
  5282. definitions of package variants (@pxref{Pakete definieren}).
  5283. @table @code
  5284. @item --with-source=@var{source}
  5285. @itemx --with-source=@var{package}=@var{source}
  5286. @itemx --with-source=@var{package}@@@var{version}=@var{source}
  5287. Use @var{source} as the source of @var{package}, and @var{version} as its
  5288. version number. @var{source} must be a file name or a URL, as for
  5289. @command{guix download} (@pxref{Aufruf von guix download}).
  5290. When @var{package} is omitted, it is taken to be the package name specified
  5291. on the command line that matches the base of @var{source}---e.g., if
  5292. @var{source} is @code{/src/guile-2.0.10.tar.gz}, the corresponding package
  5293. is @code{guile}.
  5294. Likewise, when @var{version} is omitted, the version string is inferred from
  5295. @var{source}; in the previous example, it is @code{2.0.10}.
  5296. This option allows users to try out versions of packages other than the one
  5297. provided by the distribution. The example below downloads
  5298. @file{ed-1.7.tar.gz} from a GNU mirror and uses that as the source for the
  5299. @code{ed} package:
  5300. @example
  5301. guix build ed --with-source=mirror://gnu/ed/ed-1.7.tar.gz
  5302. @end example
  5303. As a developer, @code{--with-source} makes it easy to test release
  5304. candidates:
  5305. @example
  5306. guix build guile --with-source=../guile-2.0.9.219-e1bb7.tar.xz
  5307. @end example
  5308. @dots{} or to build from a checkout in a pristine environment:
  5309. @example
  5310. $ git clone git://git.sv.gnu.org/guix.git
  5311. $ guix build guix --with-source=guix@@1.0=./guix
  5312. @end example
  5313. @item --with-input=@var{package}=@var{replacement}
  5314. Replace dependency on @var{package} by a dependency on @var{replacement}.
  5315. @var{package} must be a package name, and @var{replacement} must be a
  5316. package specification such as @code{guile} or @code{guile@@1.8}.
  5317. For instance, the following command builds Guix, but replaces its dependency
  5318. on the current stable version of Guile with a dependency on the legacy
  5319. version of Guile, @code{guile@@2.0}:
  5320. @example
  5321. guix build --with-input=guile=guile@@2.0 guix
  5322. @end example
  5323. This is a recursive, deep replacement. So in this example, both @code{guix}
  5324. and its dependency @code{guile-json} (which also depends on @code{guile})
  5325. get rebuilt against @code{guile@@2.0}.
  5326. This is implemented using the @code{package-input-rewriting} Scheme
  5327. procedure (@pxref{Pakete definieren, @code{package-input-rewriting}}).
  5328. @item --with-graft=@var{package}=@var{replacement}
  5329. This is similar to @code{--with-input} but with an important difference:
  5330. instead of rebuilding the whole dependency chain, @var{replacement} is built
  5331. and then @dfn{grafted} onto the binaries that were initially referring to
  5332. @var{package}. @xref{Sicherheitsaktualisierungen}, for more information on grafts.
  5333. For example, the command below grafts version 3.5.4 of GnuTLS onto Wget and
  5334. all its dependencies, replacing references to the version of GnuTLS they
  5335. currently refer to:
  5336. @example
  5337. guix build --with-graft=gnutls=gnutls@@3.5.4 wget
  5338. @end example
  5339. This has the advantage of being much faster than rebuilding everything. But
  5340. there is a caveat: it works if and only if @var{package} and
  5341. @var{replacement} are strictly compatible---for example, if they provide a
  5342. library, the application binary interface (ABI) of those libraries must be
  5343. compatible. If @var{replacement} is somehow incompatible with
  5344. @var{package}, then the resulting package may be unusable. Use with care!
  5345. @item --with-branch=@var{package}=@var{branch}
  5346. @cindex Git, using the latest commit
  5347. @cindex latest commit, building
  5348. Build @var{package} from the latest commit of @var{branch}. The
  5349. @code{source} field of @var{package} must be an origin with the
  5350. @code{git-fetch} method (@pxref{„origin“-Referenz}) or a @code{git-checkout}
  5351. object; the repository URL is taken from that @code{source}.
  5352. For instance, the following command builds @code{guile-sqlite3} from the
  5353. latest commit of its @code{master} branch, and then builds @code{guix}
  5354. (which depends on it) and @code{cuirass} (which depends on @code{guix})
  5355. against this specific @code{guile-sqlite3} build:
  5356. @example
  5357. guix build --with-branch=guile-sqlite3=master cuirass
  5358. @end example
  5359. @cindex continuous integration
  5360. Obviously, since it uses the latest commit of the given branch, the result
  5361. of such a command varies over time. Nevertheless it is a convenient way to
  5362. rebuild entire software stacks against the latest commit of one or more
  5363. packages. This is particularly useful in the context of continuous
  5364. integration (CI).
  5365. Checkouts are kept in a cache under @file{~/.cache/guix/checkouts} to speed
  5366. up consecutive accesses to the same repository. You may want to clean it up
  5367. once in a while to save disk space.
  5368. @item --with-commit=@var{package}=@var{commit}
  5369. This is similar to @code{--with-branch}, except that it builds from
  5370. @var{commit} rather than the tip of a branch. @var{commit} must be a valid
  5371. Git commit SHA1 identifier.
  5372. @end table
  5373. @node Zusätzliche Erstellungsoptionen
  5374. @subsection Zusätzliche Erstellungsoptionen
  5375. The command-line options presented below are specific to @command{guix
  5376. build}.
  5377. @table @code
  5378. @item --quiet
  5379. @itemx -q
  5380. Build quietly, without displaying the build log. Upon completion, the build
  5381. log is kept in @file{/var} (or similar) and can always be retrieved using
  5382. the @option{--log-file} option.
  5383. @item --file=@var{file}
  5384. @itemx -f @var{Datei}
  5385. Build the package, derivation, or other file-like object that the code
  5386. within @var{file} evaluates to (@pxref{G-Ausdrücke, file-like objects}).
  5387. As an example, @var{file} might contain a package definition like this
  5388. (@pxref{Pakete definieren}):
  5389. @example
  5390. @verbatiminclude package-hello.scm
  5391. @end example
  5392. @item --expression=@var{expr}
  5393. @itemx -e @var{expr}
  5394. Build the package or derivation @var{expr} evaluates to.
  5395. For example, @var{expr} may be @code{(@@ (gnu packages guile) guile-1.8)},
  5396. which unambiguously designates this specific variant of version 1.8 of
  5397. Guile.
  5398. Alternatively, @var{expr} may be a G-expression, in which case it is used as
  5399. a build program passed to @code{gexp->derivation} (@pxref{G-Ausdrücke}).
  5400. Lastly, @var{expr} may refer to a zero-argument monadic procedure
  5401. (@pxref{Die Store-Monade}). The procedure must return a derivation as a
  5402. monadic value, which is then passed through @code{run-with-store}.
  5403. @item --source
  5404. @itemx -S
  5405. Build the source derivations of the packages, rather than the packages
  5406. themselves.
  5407. For instance, @code{guix build -S gcc} returns something like
  5408. @file{/gnu/store/@dots{}-gcc-4.7.2.tar.bz2}, which is the GCC source
  5409. tarball.
  5410. The returned source tarball is the result of applying any patches and code
  5411. snippets specified in the package @code{origin} (@pxref{Pakete definieren}).
  5412. @item --sources
  5413. Fetch and return the source of @var{package-or-derivation} and all their
  5414. dependencies, recursively. This is a handy way to obtain a local copy of
  5415. all the source code needed to build @var{packages}, allowing you to
  5416. eventually build them even without network access. It is an extension of
  5417. the @code{--source} option and can accept one of the following optional
  5418. argument values:
  5419. @table @code
  5420. @item package
  5421. This value causes the @code{--sources} option to behave in the same way as
  5422. the @code{--source} option.
  5423. @item all
  5424. Build the source derivations of all packages, including any source that
  5425. might be listed as @code{inputs}. This is the default value.
  5426. @example
  5427. $ guix build --sources tzdata
  5428. The following derivations will be built:
  5429. /gnu/store/@dots{}-tzdata2015b.tar.gz.drv
  5430. /gnu/store/@dots{}-tzcode2015b.tar.gz.drv
  5431. @end example
  5432. @item transitive
  5433. Build the source derivations of all packages, as well of all transitive
  5434. inputs to the packages. This can be used e.g.@: to prefetch package source
  5435. for later offline building.
  5436. @example
  5437. $ guix build --sources=transitive tzdata
  5438. The following derivations will be built:
  5439. /gnu/store/@dots{}-tzcode2015b.tar.gz.drv
  5440. /gnu/store/@dots{}-findutils-4.4.2.tar.xz.drv
  5441. /gnu/store/@dots{}-grep-2.21.tar.xz.drv
  5442. /gnu/store/@dots{}-coreutils-8.23.tar.xz.drv
  5443. /gnu/store/@dots{}-make-4.1.tar.xz.drv
  5444. /gnu/store/@dots{}-bash-4.3.tar.xz.drv
  5445. @dots{}
  5446. @end example
  5447. @end table
  5448. @item --system=@var{System}
  5449. @itemx -s @var{system}
  5450. Attempt to build for @var{system}---e.g., @code{i686-linux}---instead of the
  5451. system type of the build host.
  5452. @quotation Anmerkung
  5453. The @code{--system} flag is for @emph{native} compilation and must not be
  5454. confused with cross-compilation. See @code{--target} below for information
  5455. on cross-compilation.
  5456. @end quotation
  5457. An example use of this is on Linux-based systems, which can emulate
  5458. different personalities. For instance, passing @code{--system=i686-linux}
  5459. on an @code{x86_64-linux} system or @code{--system=armhf-linux} on an
  5460. @code{aarch64-linux} system allows you to build packages in a complete
  5461. 32-bit environment.
  5462. @quotation Anmerkung
  5463. Building for an @code{armhf-linux} system is unconditionally enabled on
  5464. @code{aarch64-linux} machines, although certain aarch64 chipsets do not
  5465. allow for this functionality, notably the ThunderX.
  5466. @end quotation
  5467. Similarly, when transparent emulation with QEMU and @code{binfmt_misc} is
  5468. enabled (@pxref{Virtualisierungsdienste, @code{qemu-binfmt-service-type}}),
  5469. you can build for any system for which a QEMU @code{binfmt_misc} handler is
  5470. installed.
  5471. Builds for a system other than that of the machine you are using can also be
  5472. offloaded to a remote machine of the right architecture. @xref{Auslagern des Daemons einrichten}, for more information on offloading.
  5473. @item --target=@var{triplet}
  5474. @cindex cross-compilation
  5475. Cross-build for @var{triplet}, which must be a valid GNU triplet, such as
  5476. @code{"mips64el-linux-gnu"} (@pxref{Specifying target triplets, GNU
  5477. configuration triplets,, autoconf, Autoconf}).
  5478. @anchor{build-check}
  5479. @item --check
  5480. @cindex determinism, checking
  5481. @cindex reproducibility, checking
  5482. Rebuild @var{package-or-derivation}, which are already available in the
  5483. store, and raise an error if the build results are not bit-for-bit
  5484. identical.
  5485. This mechanism allows you to check whether previously installed substitutes
  5486. are genuine (@pxref{Substitute}), or whether the build result of a package
  5487. is deterministic. @xref{Aufruf von guix challenge}, for more background
  5488. information and tools.
  5489. Wenn dies zusammen mit @option{--keep-failed} benutzt wird, bleiben die sich
  5490. unterscheidenden Ausgaben im Store unter dem Namen
  5491. @file{/gnu/store/@dots{}-check}. Dadurch können Unterschiede zwischen den
  5492. beiden Ergebnissen leicht erkannt werden.
  5493. @item --repair
  5494. @cindex repairing store items
  5495. @cindex Datenbeschädigung, Behebung
  5496. Attempt to repair the specified store items, if they are corrupt, by
  5497. re-downloading or rebuilding them.
  5498. This operation is not atomic and thus restricted to @code{root}.
  5499. @item --derivations
  5500. @itemx -d
  5501. Return the derivation paths, not the output paths, of the given packages.
  5502. @item --root=@var{file}
  5503. @itemx -r @var{file}
  5504. @cindex GC roots, adding
  5505. @cindex garbage collector roots, adding
  5506. Make @var{file} a symlink to the result, and register it as a garbage
  5507. collector root.
  5508. Consequently, the results of this @command{guix build} invocation are
  5509. protected from garbage collection until @var{file} is removed. When that
  5510. option is omitted, build results are eligible for garbage collection as soon
  5511. as the build completes. @xref{Aufruf von guix gc}, for more on GC roots.
  5512. @item --log-file
  5513. @cindex build logs, access
  5514. Return the build log file names or URLs for the given
  5515. @var{package-or-derivation}, or raise an error if build logs are missing.
  5516. This works regardless of how packages or derivations are specified. For
  5517. instance, the following invocations are equivalent:
  5518. @example
  5519. guix build --log-file `guix build -d guile`
  5520. guix build --log-file `guix build guile`
  5521. guix build --log-file guile
  5522. guix build --log-file -e '(@@ (gnu packages guile) guile-2.0)'
  5523. @end example
  5524. If a log is unavailable locally, and unless @code{--no-substitutes} is
  5525. passed, the command looks for a corresponding log on one of the substitute
  5526. servers (as specified with @code{--substitute-urls}.)
  5527. So for instance, imagine you want to see the build log of GDB on MIPS, but
  5528. you are actually on an @code{x86_64} machine:
  5529. @example
  5530. $ guix build --log-file gdb -s mips64el-linux
  5531. https://hydra.gnu.org/log/@dots{}-gdb-7.10
  5532. @end example
  5533. You can freely access a huge library of build logs!
  5534. @end table
  5535. @node Fehlschläge beim Erstellen untersuchen
  5536. @subsection Fehlschläge beim Erstellen untersuchen
  5537. @cindex build failures, debugging
  5538. When defining a new package (@pxref{Pakete definieren}), you will probably
  5539. find yourself spending some time debugging and tweaking the build until it
  5540. succeeds. To do that, you need to operate the build commands yourself in an
  5541. environment as close as possible to the one the build daemon uses.
  5542. To that end, the first thing to do is to use the @option{--keep-failed} or
  5543. @option{-K} option of @command{guix build}, which will keep the failed build
  5544. tree in @file{/tmp} or whatever directory you specified as @code{TMPDIR}
  5545. (@pxref{Aufruf von guix build, @code{--keep-failed}}).
  5546. From there on, you can @command{cd} to the failed build tree and source the
  5547. @file{environment-variables} file, which contains all the environment
  5548. variable definitions that were in place when the build failed. So let's say
  5549. you're debugging a build failure in package @code{foo}; a typical session
  5550. would look like this:
  5551. @example
  5552. $ guix build foo -K
  5553. @dots{} @i{build fails}
  5554. $ cd /tmp/guix-build-foo.drv-0
  5555. $ source ./environment-variables
  5556. $ cd foo-1.2
  5557. @end example
  5558. Now, you can invoke commands as if you were the daemon (almost) and
  5559. troubleshoot your build process.
  5560. Sometimes it happens that, for example, a package's tests pass when you run
  5561. them manually but they fail when the daemon runs them. This can happen
  5562. because the daemon runs builds in containers where, unlike in our
  5563. environment above, network access is missing, @file{/bin/sh} does not exist,
  5564. etc. (@pxref{Einrichten der Erstellungsumgebung}).
  5565. In such cases, you may need to run inspect the build process from within a
  5566. container similar to the one the build daemon creates:
  5567. @example
  5568. $ guix build -K foo
  5569. @dots{}
  5570. $ cd /tmp/guix-build-foo.drv-0
  5571. $ guix environment --no-grafts -C foo --ad-hoc strace gdb
  5572. [env]# source ./environment-variables
  5573. [env]# cd foo-1.2
  5574. @end example
  5575. Here, @command{guix environment -C} creates a container and spawns a new
  5576. shell in it (@pxref{Aufruf von guix environment}). The @command{--ad-hoc
  5577. strace gdb} part adds the @command{strace} and @command{gdb} commands to the
  5578. container, which would may find handy while debugging. The
  5579. @option{--no-grafts} option makes sure we get the exact same environment,
  5580. with ungrafted packages (@pxref{Sicherheitsaktualisierungen}, for more info on grafts).
  5581. To get closer to a container like that used by the build daemon, we can
  5582. remove @file{/bin/sh}:
  5583. @example
  5584. [env]# rm /bin/sh
  5585. @end example
  5586. (Don't worry, this is harmless: this is all happening in the throw-away
  5587. container created by @command{guix environment}.)
  5588. The @command{strace} command is probably not in the search path, but we can
  5589. run:
  5590. @example
  5591. [env]# $GUIX_ENVIRONMENT/bin/strace -f -o log make check
  5592. @end example
  5593. In this way, not only you will have reproduced the environment variables the
  5594. daemon uses, you will also be running the build process in a container
  5595. similar to the one the daemon uses.
  5596. @node Aufruf von guix edit
  5597. @section Invoking @command{guix edit}
  5598. @cindex @command{guix edit}
  5599. @cindex package definition, editing
  5600. So many packages, so many source files! The @command{guix edit} command
  5601. facilitates the life of users and packagers by pointing their editor at the
  5602. source file containing the definition of the specified packages. For
  5603. instance:
  5604. @example
  5605. guix edit gcc@@4.9 vim
  5606. @end example
  5607. @noindent
  5608. launches the program specified in the @code{VISUAL} or in the @code{EDITOR}
  5609. environment variable to view the recipe of GCC@tie{}4.9.3 and that of Vim.
  5610. If you are using a Guix Git checkout (@pxref{Erstellung aus dem Git}), or have
  5611. created your own packages on @code{GUIX_PACKAGE_PATH} (@pxref{Paketmodule}), you will be able to edit the package recipes. In other cases,
  5612. you will be able to examine the read-only recipes for packages currently in
  5613. the store.
  5614. @node Aufruf von guix download
  5615. @section Invoking @command{guix download}
  5616. @cindex @command{guix download}
  5617. @cindex downloading package sources
  5618. When writing a package definition, developers typically need to download a
  5619. source tarball, compute its SHA256 hash, and write that hash in the package
  5620. definition (@pxref{Pakete definieren}). The @command{guix download} tool
  5621. helps with this task: it downloads a file from the given URI, adds it to the
  5622. store, and prints both its file name in the store and its SHA256 hash.
  5623. The fact that the downloaded file is added to the store saves bandwidth:
  5624. when the developer eventually tries to build the newly defined package with
  5625. @command{guix build}, the source tarball will not have to be downloaded
  5626. again because it is already in the store. It is also a convenient way to
  5627. temporarily stash files, which may be deleted eventually (@pxref{Aufruf von guix gc}).
  5628. The @command{guix download} command supports the same URIs as used in
  5629. package definitions. In particular, it supports @code{mirror://} URIs.
  5630. @code{https} URIs (HTTP over TLS) are supported @emph{provided} the Guile
  5631. bindings for GnuTLS are available in the user's environment; when they are
  5632. not available, an error is raised. @xref{Guile Preparations, how to install
  5633. the GnuTLS bindings for Guile,, gnutls-guile, GnuTLS-Guile}, for more
  5634. information.
  5635. @command{guix download} verifies HTTPS server certificates by loading the
  5636. certificates of X.509 authorities from the directory pointed to by the
  5637. @code{SSL_CERT_DIR} environment variable (@pxref{X.509-Zertifikate}),
  5638. unless @option{--no-check-certificate} is used.
  5639. The following options are available:
  5640. @table @code
  5641. @item --format=@var{fmt}
  5642. @itemx -f @var{fmt}
  5643. Write the hash in the format specified by @var{fmt}. For more information
  5644. on the valid values for @var{fmt}, @pxref{Aufruf von guix hash}.
  5645. @item --no-check-certificate
  5646. Do not validate the X.509 certificates of HTTPS servers.
  5647. When using this option, you have @emph{absolutely no guarantee} that you are
  5648. communicating with the authentic server responsible for the given URL, which
  5649. makes you vulnerable to ``man-in-the-middle'' attacks.
  5650. @item --output=@var{file}
  5651. @itemx -o @var{file}
  5652. Save the downloaded file to @var{file} instead of adding it to the store.
  5653. @end table
  5654. @node Aufruf von guix hash
  5655. @section Invoking @command{guix hash}
  5656. @cindex @command{guix hash}
  5657. The @command{guix hash} command computes the SHA256 hash of a file. It is
  5658. primarily a convenience tool for anyone contributing to the distribution: it
  5659. computes the cryptographic hash of a file, which can be used in the
  5660. definition of a package (@pxref{Pakete definieren}).
  5661. The general syntax is:
  5662. @example
  5663. guix hash @var{option} @var{file}
  5664. @end example
  5665. When @var{file} is @code{-} (a hyphen), @command{guix hash} computes the
  5666. hash of data read from standard input. @command{guix hash} has the
  5667. following options:
  5668. @table @code
  5669. @item --format=@var{fmt}
  5670. @itemx -f @var{fmt}
  5671. Write the hash in the format specified by @var{fmt}.
  5672. Supported formats: @code{nix-base32}, @code{base32}, @code{base16}
  5673. (@code{hex} and @code{hexadecimal} can be used as well).
  5674. If the @option{--format} option is not specified, @command{guix hash} will
  5675. output the hash in @code{nix-base32}. This representation is used in the
  5676. definitions of packages.
  5677. @item --recursive
  5678. @itemx -r
  5679. Compute the hash on @var{file} recursively.
  5680. @c FIXME: Replace xref above with xref to an ``Archive'' section when
  5681. @c it exists.
  5682. In this case, the hash is computed on an archive containing @var{file},
  5683. including its children if it is a directory. Some of the metadata of
  5684. @var{file} is part of the archive; for instance, when @var{file} is a
  5685. regular file, the hash is different depending on whether @var{file} is
  5686. executable or not. Metadata such as time stamps has no impact on the hash
  5687. (@pxref{Aufruf von guix archive}).
  5688. @item --exclude-vcs
  5689. @itemx -x
  5690. When combined with @option{--recursive}, exclude version control system
  5691. directories (@file{.bzr}, @file{.git}, @file{.hg}, etc.)
  5692. @vindex git-fetch
  5693. As an example, here is how you would compute the hash of a Git checkout,
  5694. which is useful when using the @code{git-fetch} method (@pxref{„origin“-Referenz}):
  5695. @example
  5696. $ git clone http://example.org/foo.git
  5697. $ cd foo
  5698. $ guix hash -rx .
  5699. @end example
  5700. @end table
  5701. @node Aufruf von guix import
  5702. @section Invoking @command{guix import}
  5703. @cindex importing packages
  5704. @cindex package import
  5705. @cindex package conversion
  5706. @cindex Invoking @command{guix import}
  5707. The @command{guix import} command is useful for people who would like to add
  5708. a package to the distribution with as little work as possible---a legitimate
  5709. demand. The command knows of a few repositories from which it can
  5710. ``import'' package metadata. The result is a package definition, or a
  5711. template thereof, in the format we know (@pxref{Pakete definieren}).
  5712. The general syntax is:
  5713. @example
  5714. guix import @var{importer} @var{options}@dots{}
  5715. @end example
  5716. @var{importer} specifies the source from which to import package metadata,
  5717. and @var{options} specifies a package identifier and other options specific
  5718. to @var{importer}. Currently, the available ``importers'' are:
  5719. @table @code
  5720. @item gnu
  5721. Import metadata for the given GNU package. This provides a template for the
  5722. latest version of that GNU package, including the hash of its source
  5723. tarball, and its canonical synopsis and description.
  5724. Additional information such as the package dependencies and its license
  5725. needs to be figured out manually.
  5726. For example, the following command returns a package definition for
  5727. GNU@tie{}Hello:
  5728. @example
  5729. guix import gnu hello
  5730. @end example
  5731. Specific command-line options are:
  5732. @table @code
  5733. @item --key-download=@var{policy}
  5734. As for @code{guix refresh}, specify the policy to handle missing OpenPGP
  5735. keys when verifying the package signature. @xref{Aufruf von guix refresh,
  5736. @code{--key-download}}.
  5737. @end table
  5738. @item pypi
  5739. @cindex pypi
  5740. Import metadata from the @uref{https://pypi.python.org/, Python Package
  5741. Index}@footnote{This functionality requires Guile-JSON to be installed.
  5742. @xref{Voraussetzungen}.}. Information is taken from the JSON-formatted
  5743. description available at @code{pypi.python.org} and usually includes all the
  5744. relevant information, including package dependencies. For maximum
  5745. efficiency, it is recommended to install the @command{unzip} utility, so
  5746. that the importer can unzip Python wheels and gather data from them.
  5747. The command below imports metadata for the @code{itsdangerous} Python
  5748. package:
  5749. @example
  5750. guix import pypi itsdangerous
  5751. @end example
  5752. @table @code
  5753. @item --recursive
  5754. @itemx -r
  5755. Traverse the dependency graph of the given upstream package recursively and
  5756. generate package expressions for all those packages that are not yet in
  5757. Guix.
  5758. @end table
  5759. @item gem
  5760. @cindex gem
  5761. Import metadata from @uref{https://rubygems.org/, RubyGems}@footnote{This
  5762. functionality requires Guile-JSON to be installed. @xref{Voraussetzungen}.}.
  5763. Information is taken from the JSON-formatted description available at
  5764. @code{rubygems.org} and includes most relevant information, including
  5765. runtime dependencies. There are some caveats, however. The metadata
  5766. doesn't distinguish between synopses and descriptions, so the same string is
  5767. used for both fields. Additionally, the details of non-Ruby dependencies
  5768. required to build native extensions is unavailable and left as an exercise
  5769. to the packager.
  5770. The command below imports metadata for the @code{rails} Ruby package:
  5771. @example
  5772. guix import gem rails
  5773. @end example
  5774. @table @code
  5775. @item --recursive
  5776. @itemx -r
  5777. Traverse the dependency graph of the given upstream package recursively and
  5778. generate package expressions for all those packages that are not yet in
  5779. Guix.
  5780. @end table
  5781. @item cpan
  5782. @cindex CPAN
  5783. Import metadata from @uref{https://www.metacpan.org/,
  5784. MetaCPAN}@footnote{This functionality requires Guile-JSON to be installed.
  5785. @xref{Voraussetzungen}.}. Information is taken from the JSON-formatted
  5786. metadata provided through @uref{https://fastapi.metacpan.org/, MetaCPAN's
  5787. API} and includes most relevant information, such as module dependencies.
  5788. License information should be checked closely. If Perl is available in the
  5789. store, then the @code{corelist} utility will be used to filter core modules
  5790. out of the list of dependencies.
  5791. The command command below imports metadata for the @code{Acme::Boolean} Perl
  5792. module:
  5793. @example
  5794. guix import cpan Acme::Boolean
  5795. @end example
  5796. @item cran
  5797. @cindex CRAN
  5798. @cindex Bioconductor
  5799. Import metadata from @uref{https://cran.r-project.org/, CRAN}, the central
  5800. repository for the @uref{http://r-project.org, GNU@tie{}R statistical and
  5801. graphical environment}.
  5802. Information is extracted from the @code{DESCRIPTION} file of the package.
  5803. The command command below imports metadata for the @code{Cairo} R package:
  5804. @example
  5805. guix import cran Cairo
  5806. @end example
  5807. When @code{--recursive} is added, the importer will traverse the dependency
  5808. graph of the given upstream package recursively and generate package
  5809. expressions for all those packages that are not yet in Guix.
  5810. When @code{--archive=bioconductor} is added, metadata is imported from
  5811. @uref{https://www.bioconductor.org/, Bioconductor}, a repository of R
  5812. packages for for the analysis and comprehension of high-throughput genomic
  5813. data in bioinformatics.
  5814. Information is extracted from the @code{DESCRIPTION} file of a package
  5815. published on the web interface of the Bioconductor SVN repository.
  5816. The command below imports metadata for the @code{GenomicRanges} R package:
  5817. @example
  5818. guix import cran --archive=bioconductor GenomicRanges
  5819. @end example
  5820. @item texlive
  5821. @cindex TeX Live
  5822. @cindex CTAN
  5823. Import metadata from @uref{http://www.ctan.org/, CTAN}, the comprehensive
  5824. TeX archive network for TeX packages that are part of the
  5825. @uref{https://www.tug.org/texlive/, TeX Live distribution}.
  5826. Information about the package is obtained through the XML API provided by
  5827. CTAN, while the source code is downloaded from the SVN repository of the Tex
  5828. Live project. This is done because the CTAN does not keep versioned
  5829. archives.
  5830. The command command below imports metadata for the @code{fontspec} TeX
  5831. package:
  5832. @example
  5833. guix import texlive fontspec
  5834. @end example
  5835. When @code{--archive=DIRECTORY} is added, the source code is downloaded not
  5836. from the @file{latex} sub-directory of the @file{texmf-dist/source} tree in
  5837. the TeX Live SVN repository, but from the specified sibling directory under
  5838. the same root.
  5839. The command below imports metadata for the @code{ifxetex} package from CTAN
  5840. while fetching the sources from the directory @file{texmf/source/generic}:
  5841. @example
  5842. guix import texlive --archive=generic ifxetex
  5843. @end example
  5844. @item json
  5845. @cindex JSON, import
  5846. Import package metadata from a local JSON file@footnote{This functionality
  5847. requires Guile-JSON to be installed. @xref{Voraussetzungen}.}. Consider the
  5848. following example package definition in JSON format:
  5849. @example
  5850. @{
  5851. "name": "hello",
  5852. "version": "2.10",
  5853. "source": "mirror://gnu/hello/hello-2.10.tar.gz",
  5854. "build-system": "gnu",
  5855. "home-page": "https://www.gnu.org/software/hello/",
  5856. "synopsis": "Hello, GNU world: An example GNU package",
  5857. "description": "GNU Hello prints a greeting.",
  5858. "license": "GPL-3.0+",
  5859. "native-inputs": ["gcc@@6"]
  5860. @}
  5861. @end example
  5862. The field names are the same as for the @code{<package>} record
  5863. (@xref{Pakete definieren}). References to other packages are provided as
  5864. JSON lists of quoted package specification strings such as @code{guile} or
  5865. @code{guile@@2.0}.
  5866. The importer also supports a more explicit source definition using the
  5867. common fields for @code{<origin>} records:
  5868. @example
  5869. @{
  5870. @dots{}
  5871. "source": @{
  5872. "method": "url-fetch",
  5873. "uri": "mirror://gnu/hello/hello-2.10.tar.gz",
  5874. "sha256": @{
  5875. "base32": "0ssi1wpaf7plaswqqjwigppsg5fyh99vdlb9kzl7c9lng89ndq1i"
  5876. @}
  5877. @}
  5878. @dots{}
  5879. @}
  5880. @end example
  5881. The command below reads metadata from the JSON file @code{hello.json} and
  5882. outputs a package expression:
  5883. @example
  5884. guix import json hello.json
  5885. @end example
  5886. @item nix
  5887. Import metadata from a local copy of the source of the
  5888. @uref{http://nixos.org/nixpkgs/, Nixpkgs distribution}@footnote{This relies
  5889. on the @command{nix-instantiate} command of @uref{http://nixos.org/nix/,
  5890. Nix}.}. Package definitions in Nixpkgs are typically written in a mixture
  5891. of Nix-language and Bash code. This command only imports the high-level
  5892. package structure that is written in the Nix language. It normally includes
  5893. all the basic fields of a package definition.
  5894. When importing a GNU package, the synopsis and descriptions are replaced by
  5895. their canonical upstream variant.
  5896. Usually, you will first need to do:
  5897. @example
  5898. export NIX_REMOTE=daemon
  5899. @end example
  5900. @noindent
  5901. so that @command{nix-instantiate} does not try to open the Nix database.
  5902. As an example, the command below imports the package definition of
  5903. LibreOffice (more precisely, it imports the definition of the package bound
  5904. to the @code{libreoffice} top-level attribute):
  5905. @example
  5906. guix import nix ~/path/to/nixpkgs libreoffice
  5907. @end example
  5908. @item hackage
  5909. @cindex hackage
  5910. Import metadata from the Haskell community's central package archive
  5911. @uref{https://hackage.haskell.org/, Hackage}. Information is taken from
  5912. Cabal files and includes all the relevant information, including package
  5913. dependencies.
  5914. Specific command-line options are:
  5915. @table @code
  5916. @item --stdin
  5917. @itemx -s
  5918. Read a Cabal file from standard input.
  5919. @item --no-test-dependencies
  5920. @itemx -t
  5921. Do not include dependencies required only by the test suites.
  5922. @item --cabal-environment=@var{alist}
  5923. @itemx -e @var{alist}
  5924. @var{alist} is a Scheme alist defining the environment in which the Cabal
  5925. conditionals are evaluated. The accepted keys are: @code{os}, @code{arch},
  5926. @code{impl} and a string representing the name of a flag. The value
  5927. associated with a flag has to be either the symbol @code{true} or
  5928. @code{false}. The value associated with other keys has to conform to the
  5929. Cabal file format definition. The default value associated with the keys
  5930. @code{os}, @code{arch} and @code{impl} is @samp{linux}, @samp{x86_64} and
  5931. @samp{ghc}, respectively.
  5932. @item --recursive
  5933. @itemx -r
  5934. Traverse the dependency graph of the given upstream package recursively and
  5935. generate package expressions for all those packages that are not yet in
  5936. Guix.
  5937. @end table
  5938. The command below imports metadata for the latest version of the @code{HTTP}
  5939. Haskell package without including test dependencies and specifying the value
  5940. of the flag @samp{network-uri} as @code{false}:
  5941. @example
  5942. guix import hackage -t -e "'((\"network-uri\" . false))" HTTP
  5943. @end example
  5944. A specific package version may optionally be specified by following the
  5945. package name by an at-sign and a version number as in the following example:
  5946. @example
  5947. guix import hackage mtl@@2.1.3.1
  5948. @end example
  5949. @item stackage
  5950. @cindex stackage
  5951. The @code{stackage} importer is a wrapper around the @code{hackage} one. It
  5952. takes a package name, looks up the package version included in a long-term
  5953. support (LTS) @uref{https://www.stackage.org, Stackage} release and uses the
  5954. @code{hackage} importer to retrieve its metadata. Note that it is up to you
  5955. to select an LTS release compatible with the GHC compiler used by Guix.
  5956. Specific command-line options are:
  5957. @table @code
  5958. @item --no-test-dependencies
  5959. @itemx -t
  5960. Do not include dependencies required only by the test suites.
  5961. @item --lts-version=@var{version}
  5962. @itemx -l @var{version}
  5963. @var{version} is the desired LTS release version. If omitted the latest
  5964. release is used.
  5965. @item --recursive
  5966. @itemx -r
  5967. Traverse the dependency graph of the given upstream package recursively and
  5968. generate package expressions for all those packages that are not yet in
  5969. Guix.
  5970. @end table
  5971. The command below imports metadata for the @code{HTTP} Haskell package
  5972. included in the LTS Stackage release version 7.18:
  5973. @example
  5974. guix import stackage --lts-version=7.18 HTTP
  5975. @end example
  5976. @item elpa
  5977. @cindex elpa
  5978. Import metadata from an Emacs Lisp Package Archive (ELPA) package repository
  5979. (@pxref{Packages,,, emacs, The GNU Emacs Manual}).
  5980. Specific command-line options are:
  5981. @table @code
  5982. @item --archive=@var{repo}
  5983. @itemx -a @var{repo}
  5984. @var{repo} identifies the archive repository from which to retrieve the
  5985. information. Currently the supported repositories and their identifiers
  5986. are:
  5987. @itemize -
  5988. @item
  5989. @uref{http://elpa.gnu.org/packages, GNU}, selected by the @code{gnu}
  5990. identifier. This is the default.
  5991. Packages from @code{elpa.gnu.org} are signed with one of the keys contained
  5992. in the GnuPG keyring at @file{share/emacs/25.1/etc/package-keyring.gpg} (or
  5993. similar) in the @code{emacs} package (@pxref{Package Installation, ELPA
  5994. package signatures,, emacs, The GNU Emacs Manual}).
  5995. @item
  5996. @uref{http://stable.melpa.org/packages, MELPA-Stable}, selected by the
  5997. @code{melpa-stable} identifier.
  5998. @item
  5999. @uref{http://melpa.org/packages, MELPA}, selected by the @code{melpa}
  6000. identifier.
  6001. @end itemize
  6002. @item --recursive
  6003. @itemx -r
  6004. Traverse the dependency graph of the given upstream package recursively and
  6005. generate package expressions for all those packages that are not yet in
  6006. Guix.
  6007. @end table
  6008. @item crate
  6009. @cindex crate
  6010. Import metadata from the crates.io Rust package repository
  6011. @uref{https://crates.io, crates.io}.
  6012. @item opam
  6013. @cindex OPAM
  6014. @cindex OCaml
  6015. Import metadata from the @uref{https://opam.ocaml.org/, OPAM} package
  6016. repository used by the OCaml community.
  6017. @end table
  6018. The structure of the @command{guix import} code is modular. It would be
  6019. useful to have more importers for other package formats, and your help is
  6020. welcome here (@pxref{Mitwirken}).
  6021. @node Aufruf von guix refresh
  6022. @section Invoking @command{guix refresh}
  6023. @cindex @command{guix refresh}
  6024. The primary audience of the @command{guix refresh} command is developers of
  6025. the GNU software distribution. By default, it reports any packages provided
  6026. by the distribution that are outdated compared to the latest upstream
  6027. version, like this:
  6028. @example
  6029. $ guix refresh
  6030. gnu/packages/gettext.scm:29:13: gettext would be upgraded from 0.18.1.1 to 0.18.2.1
  6031. gnu/packages/glib.scm:77:12: glib would be upgraded from 2.34.3 to 2.37.0
  6032. @end example
  6033. Alternately, one can specify packages to consider, in which case a warning
  6034. is emitted for packages that lack an updater:
  6035. @example
  6036. $ guix refresh coreutils guile guile-ssh
  6037. gnu/packages/ssh.scm:205:2: warning: no updater for guile-ssh
  6038. gnu/packages/guile.scm:136:12: guile would be upgraded from 2.0.12 to 2.0.13
  6039. @end example
  6040. @command{guix refresh} browses the upstream repository of each package and
  6041. determines the highest version number of the releases therein. The command
  6042. knows how to update specific types of packages: GNU packages, ELPA packages,
  6043. etc.---see the documentation for @option{--type} below. There are many
  6044. packages, though, for which it lacks a method to determine whether a new
  6045. upstream release is available. However, the mechanism is extensible, so
  6046. feel free to get in touch with us to add a new method!
  6047. Sometimes the upstream name differs from the package name used in Guix, and
  6048. @command{guix refresh} needs a little help. Most updaters honor the
  6049. @code{upstream-name} property in package definitions, which can be used to
  6050. that effect:
  6051. @example
  6052. (define-public network-manager
  6053. (package
  6054. (name "network-manager")
  6055. ;; @dots{}
  6056. (properties '((upstream-name . "NetworkManager")))))
  6057. @end example
  6058. When passed @code{--update}, it modifies distribution source files to update
  6059. the version numbers and source tarball hashes of those package recipes
  6060. (@pxref{Pakete definieren}). This is achieved by downloading each package's
  6061. latest source tarball and its associated OpenPGP signature, authenticating
  6062. the downloaded tarball against its signature using @command{gpg}, and
  6063. finally computing its hash. When the public key used to sign the tarball is
  6064. missing from the user's keyring, an attempt is made to automatically
  6065. retrieve it from a public key server; when this is successful, the key is
  6066. added to the user's keyring; otherwise, @command{guix refresh} reports an
  6067. error.
  6068. The following options are supported:
  6069. @table @code
  6070. @item --expression=@var{expr}
  6071. @itemx -e @var{expr}
  6072. Consider the package @var{expr} evaluates to.
  6073. This is useful to precisely refer to a package, as in this example:
  6074. @example
  6075. guix refresh -l -e '(@@@@ (gnu packages commencement) glibc-final)'
  6076. @end example
  6077. This command lists the dependents of the ``final'' libc (essentially all the
  6078. packages.)
  6079. @item --update
  6080. @itemx -u
  6081. Update distribution source files (package recipes) in place. This is
  6082. usually run from a checkout of the Guix source tree (@pxref{Guix vor der Installation ausführen}):
  6083. @example
  6084. $ ./pre-inst-env guix refresh -s non-core -u
  6085. @end example
  6086. @xref{Pakete definieren}, for more information on package definitions.
  6087. @item --select=[@var{subset}]
  6088. @itemx -s @var{subset}
  6089. Select all the packages in @var{subset}, one of @code{core} or
  6090. @code{non-core}.
  6091. The @code{core} subset refers to all the packages at the core of the
  6092. distribution---i.e., packages that are used to build ``everything else''.
  6093. This includes GCC, libc, Binutils, Bash, etc. Usually, changing one of
  6094. these packages in the distribution entails a rebuild of all the others.
  6095. Thus, such updates are an inconvenience to users in terms of build time or
  6096. bandwidth used to achieve the upgrade.
  6097. The @code{non-core} subset refers to the remaining packages. It is
  6098. typically useful in cases where an update of the core packages would be
  6099. inconvenient.
  6100. @item --manifest=@var{Datei}
  6101. @itemx -m @var{Datei}
  6102. Select all the packages from the manifest in @var{file}. This is useful to
  6103. check if any packages of the user manifest can be updated.
  6104. @item --type=@var{updater}
  6105. @itemx -t @var{updater}
  6106. Select only packages handled by @var{updater} (may be a comma-separated list
  6107. of updaters). Currently, @var{updater} may be one of:
  6108. @table @code
  6109. @item gnu
  6110. the updater for GNU packages;
  6111. @item gnome
  6112. the updater for GNOME packages;
  6113. @item kde
  6114. the updater for KDE packages;
  6115. @item xorg
  6116. the updater for X.org packages;
  6117. @item kernel.org
  6118. the updater for packages hosted on kernel.org;
  6119. @item elpa
  6120. the updater for @uref{http://elpa.gnu.org/, ELPA} packages;
  6121. @item cran
  6122. the updater for @uref{https://cran.r-project.org/, CRAN} packages;
  6123. @item bioconductor
  6124. the updater for @uref{https://www.bioconductor.org/, Bioconductor} R
  6125. packages;
  6126. @item cpan
  6127. the updater for @uref{http://www.cpan.org/, CPAN} packages;
  6128. @item pypi
  6129. the updater for @uref{https://pypi.python.org, PyPI} packages.
  6130. @item gem
  6131. the updater for @uref{https://rubygems.org, RubyGems} packages.
  6132. @item github
  6133. the updater for @uref{https://github.com, GitHub} packages.
  6134. @item hackage
  6135. the updater for @uref{https://hackage.haskell.org, Hackage} packages.
  6136. @item stackage
  6137. the updater for @uref{https://www.stackage.org, Stackage} packages.
  6138. @item crate
  6139. the updater for @uref{https://crates.io, Crates} packages.
  6140. @end table
  6141. For instance, the following command only checks for updates of Emacs
  6142. packages hosted at @code{elpa.gnu.org} and for updates of CRAN packages:
  6143. @example
  6144. $ guix refresh --type=elpa,cran
  6145. gnu/packages/statistics.scm:819:13: r-testthat would be upgraded from 0.10.0 to 0.11.0
  6146. gnu/packages/emacs.scm:856:13: emacs-auctex would be upgraded from 11.88.6 to 11.88.9
  6147. @end example
  6148. @end table
  6149. In addition, @command{guix refresh} can be passed one or more package names,
  6150. as in this example:
  6151. @example
  6152. $ ./pre-inst-env guix refresh -u emacs idutils gcc@@4.8
  6153. @end example
  6154. @noindent
  6155. The command above specifically updates the @code{emacs} and @code{idutils}
  6156. packages. The @code{--select} option would have no effect in this case.
  6157. When considering whether to upgrade a package, it is sometimes convenient to
  6158. know which packages would be affected by the upgrade and should be checked
  6159. for compatibility. For this the following option may be used when passing
  6160. @command{guix refresh} one or more package names:
  6161. @table @code
  6162. @item --list-updaters
  6163. @itemx -L
  6164. List available updaters and exit (see @option{--type} above.)
  6165. For each updater, display the fraction of packages it covers; at the end,
  6166. display the fraction of packages covered by all these updaters.
  6167. @item --list-dependent
  6168. @itemx -l
  6169. List top-level dependent packages that would need to be rebuilt as a result
  6170. of upgrading one or more packages.
  6171. @xref{Aufruf von guix graph, the @code{reverse-package} type of @command{guix
  6172. graph}}, for information on how to visualize the list of dependents of a
  6173. package.
  6174. @end table
  6175. Be aware that the @code{--list-dependent} option only @emph{approximates}
  6176. the rebuilds that would be required as a result of an upgrade. More
  6177. rebuilds might be required under some circumstances.
  6178. @example
  6179. $ guix refresh --list-dependent flex
  6180. Building the following 120 packages would ensure 213 dependent packages are rebuilt:
  6181. hop@@2.4.0 geiser@@0.4 notmuch@@0.18 mu@@0.9.9.5 cflow@@1.4 idutils@@4.6 @dots{}
  6182. @end example
  6183. The command above lists a set of packages that could be built to check for
  6184. compatibility with an upgraded @code{flex} package.
  6185. The following options can be used to customize GnuPG operation:
  6186. @table @code
  6187. @item --gpg=@var{command}
  6188. Use @var{command} as the GnuPG 2.x command. @var{command} is searched for
  6189. in @code{$PATH}.
  6190. @item --keyring=@var{file}
  6191. Use @var{file} as the keyring for upstream keys. @var{file} must be in the
  6192. @dfn{keybox format}. Keybox files usually have a name ending in @file{.kbx}
  6193. and the GNU@tie{}Privacy Guard (GPG) can manipulate these files
  6194. (@pxref{kbxutil, @command{kbxutil},, gnupg, Using the GNU Privacy Guard},
  6195. for information on a tool to manipulate keybox files).
  6196. When this option is omitted, @command{guix refresh} uses
  6197. @file{~/.config/guix/upstream/trustedkeys.kbx} as the keyring for upstream
  6198. signing keys. OpenPGP signatures are checked against keys from this
  6199. keyring; missing keys are downloaded to this keyring as well (see
  6200. @option{--key-download} below.)
  6201. You can export keys from your default GPG keyring into a keybox file using
  6202. commands like this one:
  6203. @example
  6204. gpg --export rms@@gnu.org | kbxutil --import-openpgp >> mykeyring.kbx
  6205. @end example
  6206. Likewise, you can fetch keys to a specific keybox file like this:
  6207. @example
  6208. gpg --no-default-keyring --keyring mykeyring.kbx \
  6209. --recv-keys @value{OPENPGP-SIGNING-KEY-ID}
  6210. @end example
  6211. @ref{GPG Configuration Options, @option{--keyring},, gnupg, Using the GNU
  6212. Privacy Guard}, for more information on GPG's @option{--keyring} option.
  6213. @item --key-download=@var{policy}
  6214. Handle missing OpenPGP keys according to @var{policy}, which may be one of:
  6215. @table @code
  6216. @item always
  6217. Always download missing OpenPGP keys from the key server, and add them to
  6218. the user's GnuPG keyring.
  6219. @item never
  6220. Never try to download missing OpenPGP keys. Instead just bail out.
  6221. @item interactive
  6222. When a package signed with an unknown OpenPGP key is encountered, ask the
  6223. user whether to download it or not. This is the default behavior.
  6224. @end table
  6225. @item --key-server=@var{host}
  6226. Use @var{host} as the OpenPGP key server when importing a public key.
  6227. @end table
  6228. The @code{github} updater uses the @uref{https://developer.github.com/v3/,
  6229. GitHub API} to query for new releases. When used repeatedly e.g.@: when
  6230. refreshing all packages, GitHub will eventually refuse to answer any further
  6231. API requests. By default 60 API requests per hour are allowed, and a full
  6232. refresh on all GitHub packages in Guix requires more than this.
  6233. Authentication with GitHub through the use of an API token alleviates these
  6234. limits. To use an API token, set the environment variable
  6235. @code{GUIX_GITHUB_TOKEN} to a token procured from
  6236. @uref{https://github.com/settings/tokens} or otherwise.
  6237. @node Aufruf von guix lint
  6238. @section Invoking @command{guix lint}
  6239. @cindex @command{guix lint}
  6240. @cindex package, checking for errors
  6241. The @command{guix lint} command is meant to help package developers avoid
  6242. common errors and use a consistent style. It runs a number of checks on a
  6243. given set of packages in order to find common mistakes in their
  6244. definitions. Available @dfn{checkers} include (see @code{--list-checkers}
  6245. for a complete list):
  6246. @table @code
  6247. @item synopsis
  6248. @itemx description
  6249. Validate certain typographical and stylistic rules about package
  6250. descriptions and synopses.
  6251. @item inputs-should-be-native
  6252. Identify inputs that should most likely be native inputs.
  6253. @item source
  6254. @itemx home-page
  6255. @itemx mirror-url
  6256. @itemx source-file-name
  6257. Probe @code{home-page} and @code{source} URLs and report those that are
  6258. invalid. Suggest a @code{mirror://} URL when applicable. Check that the
  6259. source file name is meaningful, e.g.@: is not just a version number or
  6260. ``git-checkout'', without a declared @code{file-name} (@pxref{„origin“-Referenz}).
  6261. @item cve
  6262. @cindex security vulnerabilities
  6263. @cindex CVE, Common Vulnerabilities and Exposures
  6264. Report known vulnerabilities found in the Common Vulnerabilities and
  6265. Exposures (CVE) databases of the current and past year
  6266. @uref{https://nvd.nist.gov/download.cfm#CVE_FEED, published by the US NIST}.
  6267. To view information about a particular vulnerability, visit pages such as:
  6268. @itemize
  6269. @item
  6270. @indicateurl{https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-YYYY-ABCD}
  6271. @item
  6272. @indicateurl{https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-YYYY-ABCD}
  6273. @end itemize
  6274. @noindent
  6275. where @code{CVE-YYYY-ABCD} is the CVE identifier---e.g.,
  6276. @code{CVE-2015-7554}.
  6277. Package developers can specify in package recipes the
  6278. @uref{https://nvd.nist.gov/cpe.cfm,Common Platform Enumeration (CPE)} name
  6279. and version of the package when they differ from the name or version that
  6280. Guix uses, as in this example:
  6281. @example
  6282. (package
  6283. (name "grub")
  6284. ;; @dots{}
  6285. ;; CPE calls this package "grub2".
  6286. (properties '((cpe-name . "grub2")
  6287. (cpe-version . "2.3")))
  6288. @end example
  6289. @c See <http://www.openwall.com/lists/oss-security/2017/03/15/3>.
  6290. Some entries in the CVE database do not specify which version of a package
  6291. they apply to, and would thus ``stick around'' forever. Package developers
  6292. who found CVE alerts and verified they can be ignored can declare them as in
  6293. this example:
  6294. @example
  6295. (package
  6296. (name "t1lib")
  6297. ;; @dots{}
  6298. ;; These CVEs no longer apply and can be safely ignored.
  6299. (properties `((lint-hidden-cve . ("CVE-2011-0433"
  6300. "CVE-2011-1553"
  6301. "CVE-2011-1554"
  6302. "CVE-2011-5244")))))
  6303. @end example
  6304. @item formatting
  6305. Warn about obvious source code formatting issues: trailing white space, use
  6306. of tabulations, etc.
  6307. @end table
  6308. The general syntax is:
  6309. @example
  6310. guix lint @var{options} @var{package}@dots{}
  6311. @end example
  6312. If no package is given on the command line, then all packages are checked.
  6313. The @var{options} may be zero or more of the following:
  6314. @table @code
  6315. @item --list-checkers
  6316. @itemx -l
  6317. List and describe all the available checkers that will be run on packages
  6318. and exit.
  6319. @item --checkers
  6320. @itemx -c
  6321. Only enable the checkers specified in a comma-separated list using the names
  6322. returned by @code{--list-checkers}.
  6323. @end table
  6324. @node Aufruf von guix size
  6325. @section Invoking @command{guix size}
  6326. @cindex size
  6327. @cindex package size
  6328. @cindex Abschluss
  6329. @cindex @command{guix size}
  6330. The @command{guix size} command helps package developers profile the disk
  6331. usage of packages. It is easy to overlook the impact of an additional
  6332. dependency added to a package, or the impact of using a single output for a
  6333. package that could easily be split (@pxref{Pakete mit mehreren Ausgaben.}). Such are the typical issues that @command{guix size} can
  6334. highlight.
  6335. The command can be passed one or more package specifications such as
  6336. @code{gcc@@4.8} or @code{guile:debug}, or a file name in the store.
  6337. Consider this example:
  6338. @example
  6339. $ guix size coreutils
  6340. store item total self
  6341. /gnu/store/@dots{}-gcc-5.5.0-lib 60.4 30.1 38.1%
  6342. /gnu/store/@dots{}-glibc-2.27 30.3 28.8 36.6%
  6343. /gnu/store/@dots{}-coreutils-8.28 78.9 15.0 19.0%
  6344. /gnu/store/@dots{}-gmp-6.1.2 63.1 2.7 3.4%
  6345. /gnu/store/@dots{}-bash-static-4.4.12 1.5 1.5 1.9%
  6346. /gnu/store/@dots{}-acl-2.2.52 61.1 0.4 0.5%
  6347. /gnu/store/@dots{}-attr-2.4.47 60.6 0.2 0.3%
  6348. /gnu/store/@dots{}-libcap-2.25 60.5 0.2 0.2%
  6349. total: 78.9 MiB
  6350. @end example
  6351. @cindex Abschluss
  6352. The store items listed here constitute the @dfn{transitive closure} of
  6353. Coreutils---i.e., Coreutils and all its dependencies, recursively---as would
  6354. be returned by:
  6355. @example
  6356. $ guix gc -R /gnu/store/@dots{}-coreutils-8.23
  6357. @end example
  6358. Here the output shows three columns next to store items. The first column,
  6359. labeled ``total'', shows the size in mebibytes (MiB) of the closure of the
  6360. store item---that is, its own size plus the size of all its dependencies.
  6361. The next column, labeled ``self'', shows the size of the item itself. The
  6362. last column shows the ratio of the size of the item itself to the space
  6363. occupied by all the items listed here.
  6364. In this example, we see that the closure of Coreutils weighs in at
  6365. 79@tie{}MiB, most of which is taken by libc and GCC's run-time support
  6366. libraries. (That libc and GCC's libraries represent a large fraction of the
  6367. closure is not a problem @i{per se} because they are always available on the
  6368. system anyway.)
  6369. When the package(s) passed to @command{guix size} are available in the
  6370. store@footnote{More precisely, @command{guix size} looks for the
  6371. @emph{ungrafted} variant of the given package(s), as returned by @code{guix
  6372. build @var{package} --no-grafts}. @xref{Sicherheitsaktualisierungen}, for information
  6373. on grafts.}, @command{guix size} queries the daemon to determine its
  6374. dependencies, and measures its size in the store, similar to @command{du -ms
  6375. --apparent-size} (@pxref{du invocation,,, coreutils, GNU Coreutils}).
  6376. When the given packages are @emph{not} in the store, @command{guix size}
  6377. reports information based on the available substitutes
  6378. (@pxref{Substitute}). This makes it possible it to profile disk usage of
  6379. store items that are not even on disk, only available remotely.
  6380. You can also specify several package names:
  6381. @example
  6382. $ guix size coreutils grep sed bash
  6383. store item total self
  6384. /gnu/store/@dots{}-coreutils-8.24 77.8 13.8 13.4%
  6385. /gnu/store/@dots{}-grep-2.22 73.1 0.8 0.8%
  6386. /gnu/store/@dots{}-bash-4.3.42 72.3 4.7 4.6%
  6387. /gnu/store/@dots{}-readline-6.3 67.6 1.2 1.2%
  6388. @dots{}
  6389. total: 102.3 MiB
  6390. @end example
  6391. @noindent
  6392. In this example we see that the combination of the four packages takes
  6393. 102.3@tie{}MiB in total, which is much less than the sum of each closure
  6394. since they have a lot of dependencies in common.
  6395. The available options are:
  6396. @table @option
  6397. @item --substitute-urls=@var{URLs}
  6398. Use substitute information from @var{urls}. @xref{client-substitute-urls,
  6399. the same option for @code{guix build}}.
  6400. @item --sort=@var{key}
  6401. Sort lines according to @var{key}, one of the following options:
  6402. @table @code
  6403. @item self
  6404. the size of each item (the default);
  6405. @item Abschluss
  6406. the total size of the item's closure.
  6407. @end table
  6408. @item --map-file=@var{file}
  6409. Write a graphical map of disk usage in PNG format to @var{file}.
  6410. For the example above, the map looks like this:
  6411. @image{images/coreutils-size-map,5in,, map of Coreutils disk usage produced
  6412. by @command{guix size}}
  6413. This option requires that
  6414. @uref{http://wingolog.org/software/guile-charting/, Guile-Charting} be
  6415. installed and visible in Guile's module search path. When that is not the
  6416. case, @command{guix size} fails as it tries to load it.
  6417. @item --system=@var{System}
  6418. @itemx -s @var{system}
  6419. Consider packages for @var{system}---e.g., @code{x86_64-linux}.
  6420. @end table
  6421. @node Aufruf von guix graph
  6422. @section Invoking @command{guix graph}
  6423. @cindex DAG
  6424. @cindex @command{guix graph}
  6425. @cindex Paketabhängigkeiten
  6426. Packages and their dependencies form a @dfn{graph}, specifically a directed
  6427. acyclic graph (DAG). It can quickly become difficult to have a mental model
  6428. of the package DAG, so the @command{guix graph} command provides a visual
  6429. representation of the DAG. By default, @command{guix graph} emits a DAG
  6430. representation in the input format of @uref{http://www.graphviz.org/,
  6431. Graphviz}, so its output can be passed directly to the @command{dot} command
  6432. of Graphviz. It can also emit an HTML page with embedded JavaScript code to
  6433. display a ``chord diagram'' in a Web browser, using the
  6434. @uref{https://d3js.org/, d3.js} library, or emit Cypher queries to construct
  6435. a graph in a graph database supporting the @uref{http://www.opencypher.org/,
  6436. openCypher} query language. The general syntax is:
  6437. @example
  6438. guix graph @var{options} @var{package}@dots{}
  6439. @end example
  6440. For example, the following command generates a PDF file representing the
  6441. package DAG for the GNU@tie{}Core Utilities, showing its build-time
  6442. dependencies:
  6443. @example
  6444. guix graph coreutils | dot -Tpdf > dag.pdf
  6445. @end example
  6446. The output looks like this:
  6447. @image{images/coreutils-graph,2in,,Dependency graph of the GNU Coreutils}
  6448. Nice little graph, no?
  6449. But there is more than one graph! The one above is concise: it is the graph
  6450. of package objects, omitting implicit inputs such as GCC, libc, grep, etc.
  6451. It is often useful to have such a concise graph, but sometimes one may want
  6452. to see more details. @command{guix graph} supports several types of graphs,
  6453. allowing you to choose the level of detail:
  6454. @table @code
  6455. @item package
  6456. This is the default type used in the example above. It shows the DAG of
  6457. package objects, excluding implicit dependencies. It is concise, but
  6458. filters out many details.
  6459. @item reverse-package
  6460. This shows the @emph{reverse} DAG of packages. For example:
  6461. @example
  6462. guix graph --type=reverse-package ocaml
  6463. @end example
  6464. ...@: yields the graph of packages that depend on OCaml.
  6465. Note that for core packages this can yield huge graphs. If all you want is
  6466. to know the number of packages that depend on a given package, use
  6467. @command{guix refresh --list-dependent} (@pxref{Aufruf von guix refresh,
  6468. @option{--list-dependent}}).
  6469. @item bag-emerged
  6470. This is the package DAG, @emph{including} implicit inputs.
  6471. For instance, the following command:
  6472. @example
  6473. guix graph --type=bag-emerged coreutils | dot -Tpdf > dag.pdf
  6474. @end example
  6475. ...@: yields this bigger graph:
  6476. @image{images/coreutils-bag-graph,,5in,Detailed dependency graph of the GNU
  6477. Coreutils}
  6478. At the bottom of the graph, we see all the implicit inputs of
  6479. @var{gnu-build-system} (@pxref{Erstellungssysteme, @code{gnu-build-system}}).
  6480. Now, note that the dependencies of these implicit inputs---that is, the
  6481. @dfn{bootstrap dependencies} (@pxref{Bootstrapping})---are not shown here,
  6482. for conciseness.
  6483. @item bag
  6484. Similar to @code{bag-emerged}, but this time including all the bootstrap
  6485. dependencies.
  6486. @item bag-with-origins
  6487. Similar to @code{bag}, but also showing origins and their dependencies.
  6488. @item Ableitung
  6489. This is the most detailed representation: It shows the DAG of derivations
  6490. (@pxref{Ableitungen}) and plain store items. Compared to the above
  6491. representation, many additional nodes are visible, including build scripts,
  6492. patches, Guile modules, etc.
  6493. For this type of graph, it is also possible to pass a @file{.drv} file name
  6494. instead of a package name, as in:
  6495. @example
  6496. guix graph -t derivation `guix system build -d my-config.scm`
  6497. @end example
  6498. @item module
  6499. This is the graph of @dfn{package modules} (@pxref{Paketmodule}). For
  6500. example, the following command shows the graph for the package module that
  6501. defines the @code{guile} package:
  6502. @example
  6503. guix graph -t module guile | dot -Tpdf > module-graph.pdf
  6504. @end example
  6505. @end table
  6506. All the types above correspond to @emph{build-time dependencies}. The
  6507. following graph type represents the @emph{run-time dependencies}:
  6508. @table @code
  6509. @item references
  6510. This is the graph of @dfn{references} of a package output, as returned by
  6511. @command{guix gc --references} (@pxref{Aufruf von guix gc}).
  6512. If the given package output is not available in the store, @command{guix
  6513. graph} attempts to obtain dependency information from substitutes.
  6514. Here you can also pass a store file name instead of a package name. For
  6515. example, the command below produces the reference graph of your profile
  6516. (which can be big!):
  6517. @example
  6518. guix graph -t references `readlink -f ~/.guix-profile`
  6519. @end example
  6520. @item referrers
  6521. This is the graph of the @dfn{referrers} of a store item, as returned by
  6522. @command{guix gc --referrers} (@pxref{Aufruf von guix gc}).
  6523. This relies exclusively on local information from your store. For instance,
  6524. let us suppose that the current Inkscape is available in 10 profiles on your
  6525. machine; @command{guix graph -t referrers inkscape} will show a graph rooted
  6526. at Inkscape and with those 10 profiles linked to it.
  6527. It can help determine what is preventing a store item from being garbage
  6528. collected.
  6529. @end table
  6530. The available options are the following:
  6531. @table @option
  6532. @item --type=@var{type}
  6533. @itemx -t @var{type}
  6534. Produce a graph output of @var{type}, where @var{type} must be one of the
  6535. values listed above.
  6536. @item --list-types
  6537. List the supported graph types.
  6538. @item --backend=@var{backend}
  6539. @itemx -b @var{backend}
  6540. Produce a graph using the selected @var{backend}.
  6541. @item --list-backends
  6542. List the supported graph backends.
  6543. Currently, the available backends are Graphviz and d3.js.
  6544. @item --expression=@var{expr}
  6545. @itemx -e @var{expr}
  6546. Consider the package @var{expr} evaluates to.
  6547. This is useful to precisely refer to a package, as in this example:
  6548. @example
  6549. guix graph -e '(@@@@ (gnu packages commencement) gnu-make-final)'
  6550. @end example
  6551. @item --system=@var{System}
  6552. @itemx -s @var{system}
  6553. Display the graph for @var{system}---e.g., @code{i686-linux}.
  6554. The package dependency graph is largely architecture-independent, but there
  6555. are some architecture-dependent bits that this option allows you to
  6556. visualize.
  6557. @end table
  6558. @node Aufruf von guix environment
  6559. @section Invoking @command{guix environment}
  6560. @cindex reproducible build environments
  6561. @cindex development environments
  6562. @cindex @command{guix environment}
  6563. @cindex environment, package build environment
  6564. The purpose of @command{guix environment} is to assist hackers in creating
  6565. reproducible development environments without polluting their package
  6566. profile. The @command{guix environment} tool takes one or more packages,
  6567. builds all of their inputs, and creates a shell environment to use them.
  6568. The general syntax is:
  6569. @example
  6570. guix environment @var{options} @var{package}@dots{}
  6571. @end example
  6572. The following example spawns a new shell set up for the development of
  6573. GNU@tie{}Guile:
  6574. @example
  6575. guix environment guile
  6576. @end example
  6577. If the needed dependencies are not built yet, @command{guix environment}
  6578. automatically builds them. The environment of the new shell is an augmented
  6579. version of the environment that @command{guix environment} was run in. It
  6580. contains the necessary search paths for building the given package added to
  6581. the existing environment variables. To create a ``pure'' environment, in
  6582. which the original environment variables have been unset, use the
  6583. @code{--pure} option@footnote{Users sometimes wrongfully augment environment
  6584. variables such as @code{PATH} in their @file{~/.bashrc} file. As a
  6585. consequence, when @code{guix environment} launches it, Bash may read
  6586. @file{~/.bashrc}, thereby introducing ``impurities'' in these environment
  6587. variables. It is an error to define such environment variables in
  6588. @file{.bashrc}; instead, they should be defined in @file{.bash_profile},
  6589. which is sourced only by log-in shells. @xref{Bash Startup Files,,, bash,
  6590. The GNU Bash Reference Manual}, for details on Bash start-up files.}.
  6591. @vindex GUIX_ENVIRONMENT
  6592. @command{guix environment} defines the @code{GUIX_ENVIRONMENT} variable in
  6593. the shell it spawns; its value is the file name of the profile of this
  6594. environment. This allows users to, say, define a specific prompt for
  6595. development environments in their @file{.bashrc} (@pxref{Bash Startup
  6596. Files,,, bash, The GNU Bash Reference Manual}):
  6597. @example
  6598. if [ -n "$GUIX_ENVIRONMENT" ]
  6599. then
  6600. export PS1="\u@@\h \w [dev]\$ "
  6601. fi
  6602. @end example
  6603. @noindent
  6604. ...@: or to browse the profile:
  6605. @example
  6606. $ ls "$GUIX_ENVIRONMENT/bin"
  6607. @end example
  6608. Additionally, more than one package may be specified, in which case the
  6609. union of the inputs for the given packages are used. For example, the
  6610. command below spawns a shell where all of the dependencies of both Guile and
  6611. Emacs are available:
  6612. @example
  6613. guix environment guile emacs
  6614. @end example
  6615. Sometimes an interactive shell session is not desired. An arbitrary command
  6616. may be invoked by placing the @code{--} token to separate the command from
  6617. the rest of the arguments:
  6618. @example
  6619. guix environment guile -- make -j4
  6620. @end example
  6621. In other situations, it is more convenient to specify the list of packages
  6622. needed in the environment. For example, the following command runs
  6623. @command{python} from an environment containing Python@tie{}2.7 and NumPy:
  6624. @example
  6625. guix environment --ad-hoc python2-numpy python-2.7 -- python
  6626. @end example
  6627. Furthermore, one might want the dependencies of a package and also some
  6628. additional packages that are not build-time or runtime dependencies, but are
  6629. useful when developing nonetheless. Because of this, the @code{--ad-hoc}
  6630. flag is positional. Packages appearing before @code{--ad-hoc} are
  6631. interpreted as packages whose dependencies will be added to the
  6632. environment. Packages appearing after are interpreted as packages that will
  6633. be added to the environment directly. For example, the following command
  6634. creates a Guix development environment that additionally includes Git and
  6635. strace:
  6636. @example
  6637. guix environment guix --ad-hoc git strace
  6638. @end example
  6639. Sometimes it is desirable to isolate the environment as much as possible,
  6640. for maximal purity and reproducibility. In particular, when using Guix on a
  6641. host distro that is not GuixSD, it is desirable to prevent access to
  6642. @file{/usr/bin} and other system-wide resources from the development
  6643. environment. For example, the following command spawns a Guile REPL in a
  6644. ``container'' where only the store and the current working directory are
  6645. mounted:
  6646. @example
  6647. guix environment --ad-hoc --container guile -- guile
  6648. @end example
  6649. @quotation Anmerkung
  6650. The @code{--container} option requires Linux-libre 3.19 or newer.
  6651. @end quotation
  6652. The available options are summarized below.
  6653. @table @code
  6654. @item --root=@var{file}
  6655. @itemx -r @var{file}
  6656. @cindex persistent environment
  6657. @cindex garbage collector root, for environments
  6658. Make @var{file} a symlink to the profile for this environment, and register
  6659. it as a garbage collector root.
  6660. This is useful if you want to protect your environment from garbage
  6661. collection, to make it ``persistent''.
  6662. When this option is omitted, the environment is protected from garbage
  6663. collection only for the duration of the @command{guix environment} session.
  6664. This means that next time you recreate the same environment, you could have
  6665. to rebuild or re-download packages. @xref{Aufruf von guix gc}, for more on GC
  6666. roots.
  6667. @item --expression=@var{expr}
  6668. @itemx -e @var{expr}
  6669. Create an environment for the package or list of packages that @var{expr}
  6670. evaluates to.
  6671. For example, running:
  6672. @example
  6673. guix environment -e '(@@ (gnu packages maths) petsc-openmpi)'
  6674. @end example
  6675. starts a shell with the environment for this specific variant of the PETSc
  6676. package.
  6677. Running:
  6678. @example
  6679. guix environment --ad-hoc -e '(@@ (gnu) %base-packages)'
  6680. @end example
  6681. starts a shell with all the GuixSD base packages available.
  6682. The above commands only use the default output of the given packages. To
  6683. select other outputs, two element tuples can be specified:
  6684. @example
  6685. guix environment --ad-hoc -e '(list (@@ (gnu packages bash) bash) "include")'
  6686. @end example
  6687. @item --load=@var{file}
  6688. @itemx -l @var{file}
  6689. Create an environment for the package or list of packages that the code
  6690. within @var{file} evaluates to.
  6691. Zum Beispiel könnte die @var{Datei} eine Definition wie diese enthalten
  6692. (@pxref{Pakete definieren}):
  6693. @example
  6694. @verbatiminclude environment-gdb.scm
  6695. @end example
  6696. @item --manifest=@var{Datei}
  6697. @itemx -m @var{Datei}
  6698. Create an environment for the packages contained in the manifest object
  6699. returned by the Scheme code in @var{file}.
  6700. This is similar to the same-named option in @command{guix package}
  6701. (@pxref{profile-manifest, @option{--manifest}}) and uses the same manifest
  6702. files.
  6703. @item --ad-hoc
  6704. Include all specified packages in the resulting environment, as if an @i{ad
  6705. hoc} package were defined with them as inputs. This option is useful for
  6706. quickly creating an environment without having to write a package expression
  6707. to contain the desired inputs.
  6708. For instance, the command:
  6709. @example
  6710. guix environment --ad-hoc guile guile-sdl -- guile
  6711. @end example
  6712. runs @command{guile} in an environment where Guile and Guile-SDL are
  6713. available.
  6714. Note that this example implicitly asks for the default output of
  6715. @code{guile} and @code{guile-sdl}, but it is possible to ask for a specific
  6716. output---e.g., @code{glib:bin} asks for the @code{bin} output of @code{glib}
  6717. (@pxref{Pakete mit mehreren Ausgaben.}).
  6718. This option may be composed with the default behavior of @command{guix
  6719. environment}. Packages appearing before @code{--ad-hoc} are interpreted as
  6720. packages whose dependencies will be added to the environment, the default
  6721. behavior. Packages appearing after are interpreted as packages that will be
  6722. added to the environment directly.
  6723. @item --pure
  6724. Unset existing environment variables when building the new environment.
  6725. This has the effect of creating an environment in which search paths only
  6726. contain package inputs.
  6727. @item --search-paths
  6728. Display the environment variable definitions that make up the environment.
  6729. @item --system=@var{System}
  6730. @itemx -s @var{system}
  6731. Attempt to build for @var{system}---e.g., @code{i686-linux}.
  6732. @item --container
  6733. @itemx -C
  6734. @cindex container
  6735. Run @var{command} within an isolated container. The current working
  6736. directory outside the container is mapped inside the container.
  6737. Additionally, unless overridden with @code{--user}, a dummy home directory
  6738. is created that matches the current user's home directory, and
  6739. @file{/etc/passwd} is configured accordingly. The spawned process runs as
  6740. the current user outside the container, but has root privileges in the
  6741. context of the container.
  6742. @item --network
  6743. @itemx -N
  6744. For containers, share the network namespace with the host system.
  6745. Containers created without this flag only have access to the loopback
  6746. device.
  6747. @item --link-profile
  6748. @itemx -P
  6749. For containers, link the environment profile to @file{~/.guix-profile}
  6750. within the container. This is equivalent to running the command @command{ln
  6751. -s $GUIX_ENVIRONMENT ~/.guix-profile} within the container. Linking will
  6752. fail and abort the environment if the directory already exists, which will
  6753. certainly be the case if @command{guix environment} was invoked in the
  6754. user's home directory.
  6755. Certain packages are configured to look in @code{~/.guix-profile} for
  6756. configuration files and data;@footnote{For example, the @code{fontconfig}
  6757. package inspects @file{~/.guix-profile/share/fonts} for additional fonts.}
  6758. @code{--link-profile} allows these programs to behave as expected within the
  6759. environment.
  6760. @item --user=@var{user}
  6761. @itemx -u @var{user}
  6762. For containers, use the username @var{user} in place of the current user.
  6763. The generated @file{/etc/passwd} entry within the container will contain the
  6764. name @var{user}; the home directory will be @file{/home/USER}; and no user
  6765. GECOS data will be copied. @var{user} need not exist on the system.
  6766. Additionally, any shared or exposed path (see @code{--share} and
  6767. @code{--expose} respectively) whose target is within the current user's home
  6768. directory will be remapped relative to @file{/home/USER}; this includes the
  6769. automatic mapping of the current working directory.
  6770. @example
  6771. # will expose paths as /home/foo/wd, /home/foo/test, and /home/foo/target
  6772. cd $HOME/wd
  6773. guix environment --container --user=foo \
  6774. --expose=$HOME/test \
  6775. --expose=/tmp/target=$HOME/target
  6776. @end example
  6777. While this will limit the leaking of user identity through home paths and
  6778. each of the user fields, this is only one useful component of a broader
  6779. privacy/anonymity solution---not one in and of itself.
  6780. @item --expose=@var{source}[=@var{target}]
  6781. For containers, expose the file system @var{source} from the host system as
  6782. the read-only file system @var{target} within the container. If
  6783. @var{target} is not specified, @var{source} is used as the target mount
  6784. point in the container.
  6785. The example below spawns a Guile REPL in a container in which the user's
  6786. home directory is accessible read-only via the @file{/exchange} directory:
  6787. @example
  6788. guix environment --container --expose=$HOME=/exchange --ad-hoc guile -- guile
  6789. @end example
  6790. @item --share=@var{source}[=@var{target}]
  6791. For containers, share the file system @var{source} from the host system as
  6792. the writable file system @var{target} within the container. If @var{target}
  6793. is not specified, @var{source} is used as the target mount point in the
  6794. container.
  6795. The example below spawns a Guile REPL in a container in which the user's
  6796. home directory is accessible for both reading and writing via the
  6797. @file{/exchange} directory:
  6798. @example
  6799. guix environment --container --share=$HOME=/exchange --ad-hoc guile -- guile
  6800. @end example
  6801. @end table
  6802. @command{guix environment} also supports all of the common build options
  6803. that @command{guix build} supports (@pxref{Gemeinsame Erstellungsoptionen}).
  6804. @node Aufruf von guix publish
  6805. @section Invoking @command{guix publish}
  6806. @cindex @command{guix publish}
  6807. The purpose of @command{guix publish} is to enable users to easily share
  6808. their store with others, who can then use it as a substitute server
  6809. (@pxref{Substitute}).
  6810. When @command{guix publish} runs, it spawns an HTTP server which allows
  6811. anyone with network access to obtain substitutes from it. This means that
  6812. any machine running Guix can also act as if it were a build farm, since the
  6813. HTTP interface is compatible with Hydra, the software behind the
  6814. @code{hydra.gnu.org} build farm.
  6815. For security, each substitute is signed, allowing recipients to check their
  6816. authenticity and integrity (@pxref{Substitute}). Because @command{guix
  6817. publish} uses the signing key of the system, which is only readable by the
  6818. system administrator, it must be started as root; the @code{--user} option
  6819. makes it drop root privileges early on.
  6820. The signing key pair must be generated before @command{guix publish} is
  6821. launched, using @command{guix archive --generate-key} (@pxref{Aufruf von guix archive}).
  6822. The general syntax is:
  6823. @example
  6824. guix publish @var{options}@dots{}
  6825. @end example
  6826. Running @command{guix publish} without any additional arguments will spawn
  6827. an HTTP server on port 8080:
  6828. @example
  6829. guix publish
  6830. @end example
  6831. Once a publishing server has been authorized (@pxref{Aufruf von guix archive}), the daemon may download substitutes from it:
  6832. @example
  6833. guix-daemon --substitute-urls=http://example.org:8080
  6834. @end example
  6835. By default, @command{guix publish} compresses archives on the fly as it
  6836. serves them. This ``on-the-fly'' mode is convenient in that it requires no
  6837. setup and is immediately available. However, when serving lots of clients,
  6838. we recommend using the @option{--cache} option, which enables caching of the
  6839. archives before they are sent to clients---see below for details. The
  6840. @command{guix weather} command provides a handy way to check what a server
  6841. provides (@pxref{Aufruf von guix weather}).
  6842. As a bonus, @command{guix publish} also serves as a content-addressed mirror
  6843. for source files referenced in @code{origin} records (@pxref{„origin“-Referenz}). For instance, assuming @command{guix publish} is running on
  6844. @code{example.org}, the following URL returns the raw
  6845. @file{hello-2.10.tar.gz} file with the given SHA256 hash (represented in
  6846. @code{nix-base32} format, @pxref{Aufruf von guix hash}):
  6847. @example
  6848. http://example.org/file/hello-2.10.tar.gz/sha256/0ssi1@dots{}ndq1i
  6849. @end example
  6850. Obviously, these URLs only work for files that are in the store; in other
  6851. cases, they return 404 (``Not Found'').
  6852. @cindex build logs, publication
  6853. Build logs are available from @code{/log} URLs like:
  6854. @example
  6855. http://example.org/log/gwspk@dots{}-guile-2.2.3
  6856. @end example
  6857. @noindent
  6858. When @command{guix-daemon} is configured to save compressed build logs, as
  6859. is the case by default (@pxref{Aufruf des guix-daemon}), @code{/log} URLs
  6860. return the compressed log as-is, with an appropriate @code{Content-Type}
  6861. and/or @code{Content-Encoding} header. We recommend running
  6862. @command{guix-daemon} with @code{--log-compression=gzip} since Web browsers
  6863. can automatically decompress it, which is not the case with bzip2
  6864. compression.
  6865. The following options are available:
  6866. @table @code
  6867. @item --port=@var{port}
  6868. @itemx -p @var{port}
  6869. Listen for HTTP requests on @var{port}.
  6870. @item --listen=@var{host}
  6871. Listen on the network interface for @var{host}. The default is to accept
  6872. connections from any interface.
  6873. @item --user=@var{user}
  6874. @itemx -u @var{user}
  6875. Change privileges to @var{user} as soon as possible---i.e., once the server
  6876. socket is open and the signing key has been read.
  6877. @item --compression[=@var{level}]
  6878. @itemx -C [@var{level}]
  6879. Compress data using the given @var{level}. When @var{level} is zero,
  6880. disable compression. The range 1 to 9 corresponds to different gzip
  6881. compression levels: 1 is the fastest, and 9 is the best (CPU-intensive).
  6882. The default is 3.
  6883. Unless @option{--cache} is used, compression occurs on the fly and the
  6884. compressed streams are not cached. Thus, to reduce load on the machine that
  6885. runs @command{guix publish}, it may be a good idea to choose a low
  6886. compression level, to run @command{guix publish} behind a caching proxy, or
  6887. to use @option{--cache}. Using @option{--cache} has the advantage that it
  6888. allows @command{guix publish} to add @code{Content-Length} HTTP header to
  6889. its responses.
  6890. @item --cache=@var{directory}
  6891. @itemx -c @var{directory}
  6892. Cache archives and meta-data (@code{.narinfo} URLs) to @var{directory} and
  6893. only serve archives that are in cache.
  6894. When this option is omitted, archives and meta-data are created on-the-fly.
  6895. This can reduce the available bandwidth, especially when compression is
  6896. enabled, since this may become CPU-bound. Another drawback of the default
  6897. mode is that the length of archives is not known in advance, so
  6898. @command{guix publish} does not add a @code{Content-Length} HTTP header to
  6899. its responses, which in turn prevents clients from knowing the amount of
  6900. data being downloaded.
  6901. Conversely, when @option{--cache} is used, the first request for a store
  6902. item (@i{via} a @code{.narinfo} URL) returns 404 and triggers a background
  6903. process to @dfn{bake} the archive---computing its @code{.narinfo} and
  6904. compressing the archive, if needed. Once the archive is cached in
  6905. @var{directory}, subsequent requests succeed and are served directly from
  6906. the cache, which guarantees that clients get the best possible bandwidth.
  6907. The ``baking'' process is performed by worker threads. By default, one
  6908. thread per CPU core is created, but this can be customized. See
  6909. @option{--workers} below.
  6910. When @option{--ttl} is used, cached entries are automatically deleted when
  6911. they have expired.
  6912. @item --workers=@var{N}
  6913. When @option{--cache} is used, request the allocation of @var{N} worker
  6914. threads to ``bake'' archives.
  6915. @item --ttl=@var{ttl}
  6916. Produce @code{Cache-Control} HTTP headers that advertise a time-to-live
  6917. (TTL) of @var{ttl}. @var{ttl} must denote a duration: @code{5d} means 5
  6918. days, @code{1m} means 1 month, and so on.
  6919. This allows the user's Guix to keep substitute information in cache for
  6920. @var{ttl}. However, note that @code{guix publish} does not itself guarantee
  6921. that the store items it provides will indeed remain available for as long as
  6922. @var{ttl}.
  6923. Additionally, when @option{--cache} is used, cached entries that have not
  6924. been accessed for @var{ttl} and that no longer have a corresponding item in
  6925. the store, may be deleted.
  6926. @item --nar-path=@var{path}
  6927. Use @var{path} as the prefix for the URLs of ``nar'' files (@pxref{Aufruf von guix archive, normalized archives}).
  6928. By default, nars are served at a URL such as
  6929. @code{/nar/gzip/@dots{}-coreutils-8.25}. This option allows you to change
  6930. the @code{/nar} part to @var{path}.
  6931. @item --public-key=@var{file}
  6932. @itemx --private-key=@var{file}
  6933. Use the specific @var{file}s as the public/private key pair used to sign the
  6934. store items being published.
  6935. The files must correspond to the same key pair (the private key is used for
  6936. signing and the public key is merely advertised in the signature metadata).
  6937. They must contain keys in the canonical s-expression format as produced by
  6938. @command{guix archive --generate-key} (@pxref{Aufruf von guix archive}). By
  6939. default, @file{/etc/guix/signing-key.pub} and
  6940. @file{/etc/guix/signing-key.sec} are used.
  6941. @item --repl[=@var{port}]
  6942. @itemx -r [@var{port}]
  6943. Spawn a Guile REPL server (@pxref{REPL Servers,,, guile, GNU Guile Reference
  6944. Manual}) on @var{port} (37146 by default). This is used primarily for
  6945. debugging a running @command{guix publish} server.
  6946. @end table
  6947. Enabling @command{guix publish} on a GuixSD system is a one-liner: just
  6948. instantiate a @code{guix-publish-service-type} service in the
  6949. @code{services} field of the @code{operating-system} declaration
  6950. (@pxref{guix-publish-service-type, @code{guix-publish-service-type}}).
  6951. If you are instead running Guix on a ``foreign distro'', follow these
  6952. instructions:”
  6953. @itemize
  6954. @item
  6955. If your host distro uses the systemd init system:
  6956. @example
  6957. # ln -s ~root/.guix-profile/lib/systemd/system/guix-publish.service \
  6958. /etc/systemd/system/
  6959. # systemctl start guix-publish && systemctl enable guix-publish
  6960. @end example
  6961. @item
  6962. Wenn Ihre Wirts-Distribution als »init«-System Upstart verwendet:
  6963. @example
  6964. # ln -s ~root/.guix-profile/lib/upstart/system/guix-publish.conf /etc/init/
  6965. # start guix-publish
  6966. @end example
  6967. @item
  6968. Otherwise, proceed similarly with your distro's init system.
  6969. @end itemize
  6970. @node Aufruf von guix challenge
  6971. @section Invoking @command{guix challenge}
  6972. @cindex Reproduzierbare Erstellungen
  6973. @cindex verifiable builds
  6974. @cindex @command{guix challenge}
  6975. @cindex challenge
  6976. Do the binaries provided by this server really correspond to the source code
  6977. it claims to build? Is a package build process deterministic? These are the
  6978. questions the @command{guix challenge} command attempts to answer.
  6979. The former is obviously an important question: Before using a substitute
  6980. server (@pxref{Substitute}), one had better @emph{verify} that it provides
  6981. the right binaries, and thus @emph{challenge} it. The latter is what
  6982. enables the former: If package builds are deterministic, then independent
  6983. builds of the package should yield the exact same result, bit for bit; if a
  6984. server provides a binary different from the one obtained locally, it may be
  6985. either corrupt or malicious.
  6986. We know that the hash that shows up in @file{/gnu/store} file names is the
  6987. hash of all the inputs of the process that built the file or
  6988. directory---compilers, libraries, build scripts,
  6989. etc. (@pxref{Einführung}). Assuming deterministic build processes, one
  6990. store file name should map to exactly one build output. @command{guix
  6991. challenge} checks whether there is, indeed, a single mapping by comparing
  6992. the build outputs of several independent builds of any given store item.
  6993. The command output looks like this:
  6994. @smallexample
  6995. $ guix challenge --substitute-urls="https://hydra.gnu.org https://guix.example.org"
  6996. updating list of substitutes from 'https://hydra.gnu.org'... 100.0%
  6997. updating list of substitutes from 'https://guix.example.org'... 100.0%
  6998. /gnu/store/@dots{}-openssl-1.0.2d contents differ:
  6999. local hash: 0725l22r5jnzazaacncwsvp9kgf42266ayyp814v7djxs7nk963q
  7000. https://hydra.gnu.org/nar/@dots{}-openssl-1.0.2d: 0725l22r5jnzazaacncwsvp9kgf42266ayyp814v7djxs7nk963q
  7001. https://guix.example.org/nar/@dots{}-openssl-1.0.2d: 1zy4fmaaqcnjrzzajkdn3f5gmjk754b43qkq47llbyak9z0qjyim
  7002. /gnu/store/@dots{}-git-2.5.0 contents differ:
  7003. local hash: 00p3bmryhjxrhpn2gxs2fy0a15lnip05l97205pgbk5ra395hyha
  7004. https://hydra.gnu.org/nar/@dots{}-git-2.5.0: 069nb85bv4d4a6slrwjdy8v1cn4cwspm3kdbmyb81d6zckj3nq9f
  7005. https://guix.example.org/nar/@dots{}-git-2.5.0: 0mdqa9w1p6cmli6976v4wi0sw9r4p5prkj7lzfd1877wk11c9c73
  7006. /gnu/store/@dots{}-pius-2.1.1 contents differ:
  7007. local hash: 0k4v3m9z1zp8xzzizb7d8kjj72f9172xv078sq4wl73vnq9ig3ax
  7008. https://hydra.gnu.org/nar/@dots{}-pius-2.1.1: 0k4v3m9z1zp8xzzizb7d8kjj72f9172xv078sq4wl73vnq9ig3ax
  7009. https://guix.example.org/nar/@dots{}-pius-2.1.1: 1cy25x1a4fzq5rk0pmvc8xhwyffnqz95h2bpvqsz2mpvlbccy0gs
  7010. @dots{}
  7011. 6,406 store items were analyzed:
  7012. - 4,749 (74.1%) were identical
  7013. - 525 (8.2%) differed
  7014. - 1,132 (17.7%) were inconclusive
  7015. @end smallexample
  7016. @noindent
  7017. In this example, @command{guix challenge} first scans the store to determine
  7018. the set of locally-built derivations---as opposed to store items that were
  7019. downloaded from a substitute server---and then queries all the substitute
  7020. servers. It then reports those store items for which the servers obtained a
  7021. result different from the local build.
  7022. @cindex non-determinism, in package builds
  7023. As an example, @code{guix.example.org} always gets a different answer.
  7024. Conversely, @code{hydra.gnu.org} agrees with local builds, except in the
  7025. case of Git. This might indicate that the build process of Git is
  7026. non-deterministic, meaning that its output varies as a function of various
  7027. things that Guix does not fully control, in spite of building packages in
  7028. isolated environments (@pxref{Funktionalitäten}). Most common sources of
  7029. non-determinism include the addition of timestamps in build results, the
  7030. inclusion of random numbers, and directory listings sorted by inode number.
  7031. See @uref{https://reproducible-builds.org/docs/}, for more information.
  7032. To find out what is wrong with this Git binary, we can do something along
  7033. these lines (@pxref{Aufruf von guix archive}):
  7034. @example
  7035. $ wget -q -O - https://hydra.gnu.org/nar/@dots{}-git-2.5.0 \
  7036. | guix archive -x /tmp/git
  7037. $ diff -ur --no-dereference /gnu/store/@dots{}-git.2.5.0 /tmp/git
  7038. @end example
  7039. This command shows the difference between the files resulting from the local
  7040. build, and the files resulting from the build on @code{hydra.gnu.org}
  7041. (@pxref{Overview, Comparing and Merging Files,, diffutils, Comparing and
  7042. Merging Files}). The @command{diff} command works great for text files.
  7043. When binary files differ, a better option is @uref{https://diffoscope.org/,
  7044. Diffoscope}, a tool that helps visualize differences for all kinds of files.
  7045. Once you have done that work, you can tell whether the differences are due
  7046. to a non-deterministic build process or to a malicious server. We try hard
  7047. to remove sources of non-determinism in packages to make it easier to verify
  7048. substitutes, but of course, this is a process that involves not just Guix,
  7049. but a large part of the free software community. In the meantime,
  7050. @command{guix challenge} is one tool to help address the problem.
  7051. If you are writing packages for Guix, you are encouraged to check whether
  7052. @code{hydra.gnu.org} and other substitute servers obtain the same build
  7053. result as you did with:
  7054. @example
  7055. $ guix challenge @var{package}
  7056. @end example
  7057. @noindent
  7058. where @var{package} is a package specification such as @code{guile@@2.0} or
  7059. @code{glibc:debug}.
  7060. The general syntax is:
  7061. @example
  7062. guix challenge @var{options} [@var{packages}@dots{}]
  7063. @end example
  7064. When a difference is found between the hash of a locally-built item and that
  7065. of a server-provided substitute, or among substitutes provided by different
  7066. servers, the command displays it as in the example above and its exit code
  7067. is 2 (other non-zero exit codes denote other kinds of errors.)
  7068. The one option that matters is:
  7069. @table @code
  7070. @item --substitute-urls=@var{URLs}
  7071. Consider @var{urls} the whitespace-separated list of substitute source URLs
  7072. to compare to.
  7073. @item --verbose
  7074. @itemx -v
  7075. Show details about matches (identical contents) in addition to information
  7076. about mismatches.
  7077. @end table
  7078. @node Aufruf von guix copy
  7079. @section Invoking @command{guix copy}
  7080. @cindex copy, of store items, over SSH
  7081. @cindex SSH, copy of store items
  7082. @cindex sharing store items across machines
  7083. @cindex transferring store items across machines
  7084. The @command{guix copy} command copies items from the store of one machine
  7085. to that of another machine over a secure shell (SSH)
  7086. connection@footnote{This command is available only when Guile-SSH was
  7087. found. @xref{Voraussetzungen}, for details.}. For example, the following
  7088. command copies the @code{coreutils} package, the user's profile, and all
  7089. their dependencies over to @var{host}, logged in as @var{user}:
  7090. @example
  7091. guix copy --to=@var{user}@@@var{host} \
  7092. coreutils `readlink -f ~/.guix-profile`
  7093. @end example
  7094. If some of the items to be copied are already present on @var{host}, they
  7095. are not actually sent.
  7096. The command below retrieves @code{libreoffice} and @code{gimp} from
  7097. @var{host}, assuming they are available there:
  7098. @example
  7099. guix copy --from=@var{host} libreoffice gimp
  7100. @end example
  7101. The SSH connection is established using the Guile-SSH client, which is
  7102. compatible with OpenSSH: it honors @file{~/.ssh/known_hosts} and
  7103. @file{~/.ssh/config}, and uses the SSH agent for authentication.
  7104. The key used to sign items that are sent must be accepted by the remote
  7105. machine. Likewise, the key used by the remote machine to sign items you are
  7106. retrieving must be in @file{/etc/guix/acl} so it is accepted by your own
  7107. daemon. @xref{Aufruf von guix archive}, for more information about store item
  7108. authentication.
  7109. The general syntax is:
  7110. @example
  7111. guix copy [--to=@var{spec}|--from=@var{spec}] @var{items}@dots{}
  7112. @end example
  7113. You must always specify one of the following options:
  7114. @table @code
  7115. @item --to=@var{spec}
  7116. @itemx --from=@var{spec}
  7117. Specify the host to send to or receive from. @var{spec} must be an SSH spec
  7118. such as @code{example.org}, @code{charlie@@example.org}, or
  7119. @code{charlie@@example.org:2222}.
  7120. @end table
  7121. The @var{items} can be either package names, such as @code{gimp}, or store
  7122. items, such as @file{/gnu/store/@dots{}-idutils-4.6}.
  7123. When specifying the name of a package to send, it is first built if needed,
  7124. unless @option{--dry-run} was specified. Common build options are supported
  7125. (@pxref{Gemeinsame Erstellungsoptionen}).
  7126. @node Aufruf von guix container
  7127. @section Invoking @command{guix container}
  7128. @cindex container
  7129. @cindex @command{guix container}
  7130. @quotation Anmerkung
  7131. As of version @value{VERSION}, this tool is experimental. The interface is
  7132. subject to radical change in the future.
  7133. @end quotation
  7134. The purpose of @command{guix container} is to manipulate processes running
  7135. within an isolated environment, commonly known as a ``container'', typically
  7136. created by the @command{guix environment} (@pxref{Aufruf von guix environment}) and @command{guix system container} (@pxref{Aufruf von guix system}) commands.
  7137. The general syntax is:
  7138. @example
  7139. guix container @var{action} @var{options}@dots{}
  7140. @end example
  7141. @var{action} specifies the operation to perform with a container, and
  7142. @var{options} specifies the context-specific arguments for the action.
  7143. The following actions are available:
  7144. @table @code
  7145. @item exec
  7146. Execute a command within the context of a running container.
  7147. The syntax is:
  7148. @example
  7149. guix container exec @var{pid} @var{program} @var{arguments}@dots{}
  7150. @end example
  7151. @var{pid} specifies the process ID of the running container. @var{program}
  7152. specifies an executable file name within the root file system of the
  7153. container. @var{arguments} are the additional options that will be passed
  7154. to @var{program}.
  7155. The following command launches an interactive login shell inside a GuixSD
  7156. container, started by @command{guix system container}, and whose process ID
  7157. is 9001:
  7158. @example
  7159. guix container exec 9001 /run/current-system/profile/bin/bash --login
  7160. @end example
  7161. Note that the @var{pid} cannot be the parent process of a container. It
  7162. must be PID 1 of the container or one of its child processes.
  7163. @end table
  7164. @node Aufruf von guix weather
  7165. @section Invoking @command{guix weather}
  7166. Occasionally you're grumpy because substitutes are lacking and you end up
  7167. building packages by yourself (@pxref{Substitute}). The @command{guix
  7168. weather} command reports on substitute availability on the specified servers
  7169. so you can have an idea of whether you'll be grumpy today. It can sometimes
  7170. be useful info as a user, but it is primarily useful to people running
  7171. @command{guix publish} (@pxref{Aufruf von guix publish}).
  7172. @cindex statistics, for substitutes
  7173. @cindex availability of substitutes
  7174. @cindex substitute availability
  7175. @cindex weather, substitute availability
  7176. Here's a sample run:
  7177. @example
  7178. $ guix weather --substitute-urls=https://guix.example.org
  7179. computing 5,872 package derivations for x86_64-linux...
  7180. looking for 6,128 store items on https://guix.example.org..
  7181. updating list of substitutes from 'https://guix.example.org'... 100.0%
  7182. https://guix.example.org
  7183. 43.4% substitutes available (2,658 out of 6,128)
  7184. 7,032.5 MiB of nars (compressed)
  7185. 19,824.2 MiB on disk (uncompressed)
  7186. 0.030 seconds per request (182.9 seconds in total)
  7187. 33.5 requests per second
  7188. 9.8% (342 out of 3,470) of the missing items are queued
  7189. 867 queued builds
  7190. x86_64-linux: 518 (59.7%)
  7191. i686-linux: 221 (25.5%)
  7192. aarch64-linux: 128 (14.8%)
  7193. build rate: 23.41 builds per hour
  7194. x86_64-linux: 11.16 builds per hour
  7195. i686-linux: 6.03 builds per hour
  7196. aarch64-linux: 6.41 builds per hour
  7197. @end example
  7198. @cindex continuous integration, statistics
  7199. As you can see, it reports the fraction of all the packages for which
  7200. substitutes are available on the server---regardless of whether substitutes
  7201. are enabled, and regardless of whether this server's signing key is
  7202. authorized. It also reports the size of the compressed archives (``nars'')
  7203. provided by the server, the size the corresponding store items occupy in the
  7204. store (assuming deduplication is turned off), and the server's throughput.
  7205. The second part gives continuous integration (CI) statistics, if the server
  7206. supports it.
  7207. To achieve that, @command{guix weather} queries over HTTP(S) meta-data
  7208. (@dfn{narinfos}) for all the relevant store items. Like @command{guix
  7209. challenge}, it ignores signatures on those substitutes, which is innocuous
  7210. since the command only gathers statistics and cannot install those
  7211. substitutes.
  7212. Among other things, it is possible to query specific system types and
  7213. specific package sets. The available options are listed below.
  7214. @table @code
  7215. @item --substitute-urls=@var{URLs}
  7216. @var{urls} is the space-separated list of substitute server URLs to query.
  7217. When this option is omitted, the default set of substitute servers is
  7218. queried.
  7219. @item --system=@var{System}
  7220. @itemx -s @var{system}
  7221. Query substitutes for @var{system}---e.g., @code{aarch64-linux}. This
  7222. option can be repeated, in which case @command{guix weather} will query
  7223. substitutes for several system types.
  7224. @item --manifest=@var{Datei}
  7225. Instead of querying substitutes for all the packages, only ask for those
  7226. specified in @var{file}. @var{file} must contain a @dfn{manifest}, as with
  7227. the @code{-m} option of @command{guix package} (@pxref{Aufruf von guix package}).
  7228. @end table
  7229. @node Invoking guix processes
  7230. @section Invoking @command{guix processes}
  7231. The @command{guix processes} command can be useful to developers and system
  7232. administrators, especially on multi-user machines and on build farms: it
  7233. lists the current sessions (connections to the daemon), as well as
  7234. information about the processes involved@footnote{Remote sessions, when
  7235. @command{guix-daemon} is started with @option{--listen} specifying a TCP
  7236. endpoint, are @emph{not} listed.}. Here's an example of the information it
  7237. returns:
  7238. @example
  7239. $ sudo guix processes
  7240. SessionPID: 19002
  7241. ClientPID: 19090
  7242. ClientCommand: guix environment --ad-hoc python
  7243. SessionPID: 19402
  7244. ClientPID: 19367
  7245. ClientCommand: guix publish -u guix-publish -p 3000 -C 9 @dots{}
  7246. SessionPID: 19444
  7247. ClientPID: 19419
  7248. ClientCommand: cuirass --cache-directory /var/cache/cuirass @dots{}
  7249. LockHeld: /gnu/store/@dots{}-perl-ipc-cmd-0.96.lock
  7250. LockHeld: /gnu/store/@dots{}-python-six-bootstrap-1.11.0.lock
  7251. LockHeld: /gnu/store/@dots{}-libjpeg-turbo-2.0.0.lock
  7252. ChildProcess: 20495: guix offload x86_64-linux 7200 1 28800
  7253. ChildProcess: 27733: guix offload x86_64-linux 7200 1 28800
  7254. ChildProcess: 27793: guix offload x86_64-linux 7200 1 28800
  7255. @end example
  7256. In this example we see that @command{guix-daemon} has three clients:
  7257. @command{guix environment}, @command{guix publish}, and the Cuirass
  7258. continuous integration tool; their process identifier (PID) is given by the
  7259. @code{ClientPID} field. The @code{SessionPID} field gives the PID of the
  7260. @command{guix-daemon} sub-process of this particular session.
  7261. The @code{LockHeld} fields show which store items are currently locked by
  7262. this session, which corresponds to store items being built or substituted
  7263. (the @code{LockHeld} field is not displayed when @command{guix processes} is
  7264. not running as root.) Last, by looking at the @code{ChildProcess} field, we
  7265. understand that these three builds are being offloaded (@pxref{Auslagern des Daemons einrichten}).
  7266. The output is in Recutils format so we can use the handy @command{recsel}
  7267. command to select sessions of interest (@pxref{Selection Expressions,,,
  7268. recutils, GNU recutils manual}). As an example, the command shows the
  7269. command line and PID of the client that triggered the build of a Perl
  7270. package:
  7271. @example
  7272. $ sudo guix processes | \
  7273. recsel -p ClientPID,ClientCommand -e 'LockHeld ~ "perl"'
  7274. ClientPID: 19419
  7275. ClientCommand: cuirass --cache-directory /var/cache/cuirass @dots{}
  7276. @end example
  7277. @c *********************************************************************
  7278. @node GNU-Distribution
  7279. @chapter GNU-Distribution
  7280. @cindex Guix System Distribution
  7281. @cindex GuixSD
  7282. Guix comes with a distribution of the GNU system consisting entirely of free
  7283. software@footnote{The term ``free'' here refers to the
  7284. @url{http://www.gnu.org/philosophy/free-sw.html,freedom provided to users of
  7285. that software}.}. The distribution can be installed on its own
  7286. (@pxref{Systeminstallation}), but it is also possible to install Guix as a
  7287. package manager on top of an installed GNU/Linux system
  7288. (@pxref{Installation}). To distinguish between the two, we refer to the
  7289. standalone distribution as the Guix System Distribution, or GuixSD.
  7290. The distribution provides core GNU packages such as GNU libc, GCC, and
  7291. Binutils, as well as many GNU and non-GNU applications. The complete list
  7292. of available packages can be browsed
  7293. @url{http://www.gnu.org/software/guix/packages,on-line} or by running
  7294. @command{guix package} (@pxref{Aufruf von guix package}):
  7295. @example
  7296. guix package --list-available
  7297. @end example
  7298. Our goal is to provide a practical 100% free software distribution of
  7299. Linux-based and other variants of GNU, with a focus on the promotion and
  7300. tight integration of GNU components, and an emphasis on programs and tools
  7301. that help users exert that freedom.
  7302. Packages are currently available on the following platforms:
  7303. @table @code
  7304. @item x86_64-linux
  7305. Intel/AMD @code{x86_64} architecture, Linux-Libre kernel;
  7306. @item i686-linux
  7307. Intel 32-bit architecture (IA32), Linux-Libre kernel;
  7308. @item armhf-linux
  7309. ARMv7-A architecture with hard float, Thumb-2 and NEON, using the EABI
  7310. hard-float application binary interface (ABI), and Linux-Libre kernel.
  7311. @item aarch64-linux
  7312. little-endian 64-bit ARMv8-A processors, Linux-Libre kernel. This is
  7313. currently in an experimental stage, with limited support.
  7314. @xref{Mitwirken}, for how to help!
  7315. @item mips64el-linux
  7316. little-endian 64-bit MIPS processors, specifically the Loongson series, n32
  7317. ABI, and Linux-Libre kernel.
  7318. @end table
  7319. GuixSD itself is currently only available on @code{i686} and @code{x86_64}.
  7320. @noindent
  7321. For information on porting to other architectures or kernels,
  7322. @pxref{Portierung}.
  7323. @menu
  7324. * Systeminstallation:: Das ganze Betriebssystem installieren.
  7325. * Systemkonfiguration:: Das Betriebssystem konfigurieren.
  7326. * Dokumentation:: Wie man Nutzerhandbücher von Software liest.
  7327. * Dateien zur Fehlersuche installieren:: Womit man seinen Debugger
  7328. füttert.
  7329. * Sicherheitsaktualisierungen:: Sicherheits-Patches schnell einspielen.
  7330. * Paketmodule:: Pakete aus Sicht des Programmierers.
  7331. * Paketrichtlinien:: Die Distribution wachsen lassen.
  7332. * Bootstrapping:: GNU/Linux von Grund auf selbst erstellen.
  7333. * Portierung:: Guix auf andere Plattformen und Kernels
  7334. bringen.
  7335. @end menu
  7336. Building this distribution is a cooperative effort, and you are invited to
  7337. join! @xref{Mitwirken}, for information about how you can help.
  7338. @node Systeminstallation
  7339. @section Systeminstallation
  7340. @cindex installing GuixSD
  7341. @cindex Guix System Distribution
  7342. This section explains how to install the Guix System Distribution (GuixSD)
  7343. on a machine. The Guix package manager can also be installed on top of a
  7344. running GNU/Linux system, @pxref{Installation}.
  7345. @ifinfo
  7346. @quotation Anmerkung
  7347. @c This paragraph is for people reading this from tty2 of the
  7348. @c installation image.
  7349. You are reading this documentation with an Info reader. For details on how
  7350. to use it, hit the @key{RET} key (``return'' or ``enter'') on the link that
  7351. follows: @pxref{Top, Info reader,, info-stnd, Stand-alone GNU Info}. Hit
  7352. @kbd{l} afterwards to come back here.
  7353. Alternately, run @command{info info} in another tty to keep the manual
  7354. available.
  7355. @end quotation
  7356. @end ifinfo
  7357. @menu
  7358. * Einschränkungen:: Was Sie erwarten dürfen.
  7359. * Hardware-Überlegungen:: Unterstützte Hardware.
  7360. * Installation von USB-Stick oder DVD:: Das Installationsmedium
  7361. vorbereiten.
  7362. * Vor der Installation:: Netzwerkanbindung, Partitionierung etc.
  7363. * Fortfahren mit der Installation:: Die Hauptsache.
  7364. * GuixSD in einer VM installieren:: Ein GuixSD-Spielplatz.
  7365. * Ein Abbild zur Installation erstellen:: Wie ein solches entsteht.
  7366. @end menu
  7367. @node Einschränkungen
  7368. @subsection Einschränkungen
  7369. As of version @value{VERSION}, the Guix System Distribution (GuixSD) is not
  7370. production-ready. It may contain bugs and lack important features. Thus,
  7371. if you are looking for a stable production system that respects your freedom
  7372. as a computer user, a good solution at this point is to consider
  7373. @url{http://www.gnu.org/distros/free-distros.html, one of the more
  7374. established GNU/Linux distributions}. We hope you can soon switch to the
  7375. GuixSD without fear, of course. In the meantime, you can also keep using
  7376. your distribution and try out the package manager on top of it
  7377. (@pxref{Installation}).
  7378. Before you proceed with the installation, be aware of the following
  7379. noteworthy limitations applicable to version @value{VERSION}:
  7380. @itemize
  7381. @item
  7382. The installation process does not include a graphical user interface and
  7383. requires familiarity with GNU/Linux (see the following subsections to get a
  7384. feel of what that means.)
  7385. @item
  7386. Support for the Logical Volume Manager (LVM) is missing.
  7387. @item
  7388. More and more system services are provided (@pxref{Dienste}), but some may
  7389. be missing.
  7390. @item
  7391. More than 7,500 packages are available, but you might occasionally find that
  7392. a useful package is missing.
  7393. @item
  7394. GNOME, Xfce, LXDE, and Enlightenment are available (@pxref{Desktop-Dienste}), as well as a number of X11 window managers. However, some
  7395. graphical applications may be missing, as well as KDE.
  7396. @end itemize
  7397. You have been warned! But more than a disclaimer, this is an invitation to
  7398. report issues (and success stories!), and to join us in improving it.
  7399. @xref{Mitwirken}, for more info.
  7400. @node Hardware-Überlegungen
  7401. @subsection Hardware-Überlegungen
  7402. @cindex hardware support on GuixSD
  7403. GNU@tie{}GuixSD focuses on respecting the user's computing freedom. It
  7404. builds around the kernel Linux-libre, which means that only hardware for
  7405. which free software drivers and firmware exist is supported. Nowadays, a
  7406. wide range of off-the-shelf hardware is supported on GNU/Linux-libre---from
  7407. keyboards to graphics cards to scanners and Ethernet controllers.
  7408. Unfortunately, there are still areas where hardware vendors deny users
  7409. control over their own computing, and such hardware is not supported on
  7410. GuixSD.
  7411. @cindex WiFi, hardware support
  7412. One of the main areas where free drivers or firmware are lacking is WiFi
  7413. devices. WiFi devices known to work include those using Atheros chips
  7414. (AR9271 and AR7010), which corresponds to the @code{ath9k} Linux-libre
  7415. driver, and those using Broadcom/AirForce chips (BCM43xx with Wireless-Core
  7416. Revision 5), which corresponds to the @code{b43-open} Linux-libre driver.
  7417. Free firmware exists for both and is available out-of-the-box on GuixSD, as
  7418. part of @var{%base-firmware} (@pxref{„operating-system“-Referenz,
  7419. @code{firmware}}).
  7420. @cindex RYF, Respects Your Freedom
  7421. The @uref{https://www.fsf.org/, Free Software Foundation} runs
  7422. @uref{https://www.fsf.org/ryf, @dfn{Respects Your Freedom}} (RYF), a
  7423. certification program for hardware products that respect your freedom and
  7424. your privacy and ensure that you have control over your device. We
  7425. encourage you to check the list of RYF-certified devices.
  7426. Another useful resource is the @uref{https://www.h-node.org/, H-Node} web
  7427. site. It contains a catalog of hardware devices with information about
  7428. their support in GNU/Linux.
  7429. @node Installation von USB-Stick oder DVD
  7430. @subsection Installation von USB-Stick oder DVD
  7431. An ISO-9660 installation image that can be written to a USB stick or burnt
  7432. to a DVD can be downloaded from
  7433. @indicateurl{https://alpha.gnu.org/gnu/guix/guixsd-install-@value{VERSION}.@var{system}.iso.xz},
  7434. where @var{system} is one of:
  7435. @table @code
  7436. @item x86_64-linux
  7437. for a GNU/Linux system on Intel/AMD-compatible 64-bit CPUs;
  7438. @item i686-linux
  7439. for a 32-bit GNU/Linux system on Intel-compatible CPUs.
  7440. @end table
  7441. @c start duplication of authentication part from ``Binary Installation''
  7442. Make sure to download the associated @file{.sig} file and to verify the
  7443. authenticity of the image against it, along these lines:
  7444. @example
  7445. $ wget https://alpha.gnu.org/gnu/guix/guixsd-install-@value{VERSION}.@var{system}.iso.xz.sig
  7446. $ gpg --verify guixsd-install-@value{VERSION}.@var{system}.iso.xz.sig
  7447. @end example
  7448. Falls dieser Befehl fehlschlägt, weil Sie nicht über den nötigen
  7449. öffentlichen Schlüssel verfügen, können Sie ihn mit diesem Befehl
  7450. importieren:
  7451. @example
  7452. $ gpg --keyserver @value{KEY-SERVER} \
  7453. --recv-keys @value{OPENPGP-SIGNING-KEY-ID}
  7454. @end example
  7455. @noindent
  7456. @c end duplication
  7457. und den Befehl @code{gpg --verify} erneut ausführen.
  7458. This image contains the tools necessary for an installation. It is meant to
  7459. be copied @emph{as is} to a large-enough USB stick or DVD.
  7460. @unnumberedsubsubsec Copying to a USB Stick
  7461. To copy the image to a USB stick, follow these steps:
  7462. @enumerate
  7463. @item
  7464. Decompress the image using the @command{xz} command:
  7465. @example
  7466. xz -d guixsd-install-@value{VERSION}.@var{system}.iso.xz
  7467. @end example
  7468. @item
  7469. Insert a USB stick of 1@tie{}GiB or more into your machine, and determine
  7470. its device name. Assuming that the USB stick is known as @file{/dev/sdX},
  7471. copy the image with:
  7472. @example
  7473. dd if=guixsd-install-@value{VERSION}.x86_64-linux.iso of=/dev/sdX
  7474. sync
  7475. @end example
  7476. Access to @file{/dev/sdX} usually requires root privileges.
  7477. @end enumerate
  7478. @unnumberedsubsubsec Burning on a DVD
  7479. To copy the image to a DVD, follow these steps:
  7480. @enumerate
  7481. @item
  7482. Decompress the image using the @command{xz} command:
  7483. @example
  7484. xz -d guixsd-install-@value{VERSION}.@var{system}.iso.xz
  7485. @end example
  7486. @item
  7487. Insert a blank DVD into your machine, and determine its device name.
  7488. Assuming that the DVD drive is known as @file{/dev/srX}, copy the image
  7489. with:
  7490. @example
  7491. growisofs -dvd-compat -Z /dev/srX=guixsd-install-@value{VERSION}.x86_64.iso
  7492. @end example
  7493. Access to @file{/dev/srX} usually requires root privileges.
  7494. @end enumerate
  7495. @unnumberedsubsubsec Booting
  7496. Once this is done, you should be able to reboot the system and boot from the
  7497. USB stick or DVD. The latter usually requires you to get in the BIOS or
  7498. UEFI boot menu, where you can choose to boot from the USB stick.
  7499. @xref{GuixSD in einer VM installieren}, if, instead, you would like to install
  7500. GuixSD in a virtual machine (VM).
  7501. @node Vor der Installation
  7502. @subsection Vor der Installation
  7503. Once you have successfully booted your computer using the installation
  7504. medium, you should end up with a root prompt. Several console TTYs are
  7505. configured and can be used to run commands as root. TTY2 shows this
  7506. documentation, browsable using the Info reader commands (@pxref{Top,,,
  7507. info-stnd, Stand-alone GNU Info}). The installation system runs the GPM
  7508. mouse daemon, which allows you to select text with the left mouse button and
  7509. to paste it with the middle button.
  7510. @quotation Anmerkung
  7511. Installation requires access to the Internet so that any missing
  7512. dependencies of your system configuration can be downloaded. See the
  7513. ``Networking'' section below.
  7514. @end quotation
  7515. The installation system includes many common tools needed for this task.
  7516. But it is also a full-blown GuixSD system, which means that you can install
  7517. additional packages, should you need it, using @command{guix package}
  7518. (@pxref{Aufruf von guix package}).
  7519. @subsubsection Keyboard Layout
  7520. @cindex keyboard layout
  7521. The installation image uses the US qwerty keyboard layout. If you want to
  7522. change it, you can use the @command{loadkeys} command. For example, the
  7523. following command selects the Dvorak keyboard layout:
  7524. @example
  7525. loadkeys dvorak
  7526. @end example
  7527. See the files under @file{/run/current-system/profile/share/keymaps} for a
  7528. list of available keyboard layouts. Run @command{man loadkeys} for more
  7529. information.
  7530. @subsubsection Networking
  7531. Run the following command to see what your network interfaces are called:
  7532. @example
  7533. ifconfig -a
  7534. @end example
  7535. @noindent
  7536. @dots{} or, using the GNU/Linux-specific @command{ip} command:
  7537. @example
  7538. ip a
  7539. @end example
  7540. @c http://cgit.freedesktop.org/systemd/systemd/tree/src/udev/udev-builtin-net_id.c#n20
  7541. Wired interfaces have a name starting with @samp{e}; for example, the
  7542. interface corresponding to the first on-board Ethernet controller is called
  7543. @samp{eno1}. Wireless interfaces have a name starting with @samp{w}, like
  7544. @samp{w1p2s0}.
  7545. @table @asis
  7546. @item Wired connection
  7547. To configure a wired network run the following command, substituting
  7548. @var{interface} with the name of the wired interface you want to use.
  7549. @example
  7550. ifconfig @var{interface} up
  7551. @end example
  7552. @item Wireless connection
  7553. @cindex wireless
  7554. @cindex WiFi
  7555. To configure wireless networking, you can create a configuration file for
  7556. the @command{wpa_supplicant} configuration tool (its location is not
  7557. important) using one of the available text editors such as @command{nano}:
  7558. @example
  7559. nano wpa_supplicant.conf
  7560. @end example
  7561. As an example, the following stanza can go to this file and will work for
  7562. many wireless networks, provided you give the actual SSID and passphrase for
  7563. the network you are connecting to:
  7564. @example
  7565. network=@{
  7566. ssid="@var{my-ssid}"
  7567. key_mgmt=WPA-PSK
  7568. psk="the network's secret passphrase"
  7569. @}
  7570. @end example
  7571. Start the wireless service and run it in the background with the following
  7572. command (substitute @var{interface} with the name of the network interface
  7573. you want to use):
  7574. @example
  7575. wpa_supplicant -c wpa_supplicant.conf -i @var{interface} -B
  7576. @end example
  7577. Run @command{man wpa_supplicant} for more information.
  7578. @end table
  7579. @cindex DHCP
  7580. At this point, you need to acquire an IP address. On a network where IP
  7581. addresses are automatically assigned @i{via} DHCP, you can run:
  7582. @example
  7583. dhclient -v @var{interface}
  7584. @end example
  7585. Try to ping a server to see if networking is up and running:
  7586. @example
  7587. ping -c 3 gnu.org
  7588. @end example
  7589. Setting up network access is almost always a requirement because the image
  7590. does not contain all the software and tools that may be needed.
  7591. @cindex installing over SSH
  7592. If you want to, you can continue the installation remotely by starting an
  7593. SSH server:
  7594. @example
  7595. herd start ssh-daemon
  7596. @end example
  7597. Make sure to either set a password with @command{passwd}, or configure
  7598. OpenSSH public key authentication before logging in.
  7599. @subsubsection Disk Partitioning
  7600. Unless this has already been done, the next step is to partition, and then
  7601. format the target partition(s).
  7602. The installation image includes several partitioning tools, including Parted
  7603. (@pxref{Overview,,, parted, GNU Parted User Manual}), @command{fdisk}, and
  7604. @command{cfdisk}. Run it and set up your disk with the partition layout you
  7605. want:
  7606. @example
  7607. cfdisk
  7608. @end example
  7609. If your disk uses the GUID Partition Table (GPT) format and you plan to
  7610. install BIOS-based GRUB (which is the default), make sure a BIOS Boot
  7611. Partition is available (@pxref{BIOS installation,,, grub, GNU GRUB manual}).
  7612. @cindex EFI, installation
  7613. @cindex UEFI, installation
  7614. @cindex ESP, EFI system partition
  7615. If you instead wish to use EFI-based GRUB, a FAT32 @dfn{EFI System
  7616. Partition} (ESP) is required. This partition should be mounted at
  7617. @file{/boot/efi} and must have the @code{esp} flag set. E.g., for
  7618. @command{parted}:
  7619. @example
  7620. parted /dev/sda set 1 esp on
  7621. @end example
  7622. @quotation Anmerkung
  7623. @vindex grub-bootloader
  7624. @vindex grub-efi-bootloader
  7625. Unsure whether to use EFI- or BIOS-based GRUB? If the directory
  7626. @file{/sys/firmware/efi} exists in the installation image, then you should
  7627. probably perform an EFI installation, using @code{grub-efi-bootloader}.
  7628. Otherwise you should use the BIOS-based GRUB, known as
  7629. @code{grub-bootloader}. @xref{Bootloader-Konfiguration}, for more info on
  7630. bootloaders.
  7631. @end quotation
  7632. Once you are done partitioning the target hard disk drive, you have to
  7633. create a file system on the relevant partition(s)@footnote{Currently GuixSD
  7634. only supports ext4 and btrfs file systems. In particular, code that reads
  7635. file system UUIDs and labels only works for these file system types.}. For
  7636. the ESP, if you have one and assuming it is @file{/dev/sda1}, run:
  7637. @example
  7638. mkfs.fat -F32 /dev/sda1
  7639. @end example
  7640. Preferably, assign file systems a label so that you can easily and reliably
  7641. refer to them in @code{file-system} declarations (@pxref{Dateisysteme}).
  7642. This is typically done using the @code{-L} option of @command{mkfs.ext4} and
  7643. related commands. So, assuming the target root partition lives at
  7644. @file{/dev/sda2}, a file system with the label @code{my-root} can be created
  7645. with:
  7646. @example
  7647. mkfs.ext4 -L my-root /dev/sda2
  7648. @end example
  7649. @cindex encrypted disk
  7650. If you are instead planning to encrypt the root partition, you can use the
  7651. Cryptsetup/LUKS utilities to do that (see @inlinefmtifelse{html,
  7652. @uref{https://linux.die.net/man/8/cryptsetup, @code{man cryptsetup}},
  7653. @code{man cryptsetup}} for more information.) Assuming you want to store
  7654. the root partition on @file{/dev/sda2}, the command sequence would be along
  7655. these lines:
  7656. @example
  7657. cryptsetup luksFormat /dev/sda2
  7658. cryptsetup open --type luks /dev/sda2 my-partition
  7659. mkfs.ext4 -L my-root /dev/mapper/my-partition
  7660. @end example
  7661. Once that is done, mount the target file system under @file{/mnt} with a
  7662. command like (again, assuming @code{my-root} is the label of the root file
  7663. system):
  7664. @example
  7665. mount LABEL=my-root /mnt
  7666. @end example
  7667. Also mount any other file systems you would like to use on the target system
  7668. relative to this path. If you have @file{/boot} on a separate partition for
  7669. example, mount it at @file{/mnt/boot} now so it is found by @code{guix
  7670. system init} afterwards.
  7671. Finally, if you plan to use one or more swap partitions (@pxref{Memory
  7672. Concepts, swap space,, libc, The GNU C Library Reference Manual}), make sure
  7673. to initialize them with @command{mkswap}. Assuming you have one swap
  7674. partition on @file{/dev/sda3}, you would run:
  7675. @example
  7676. mkswap /dev/sda3
  7677. swapon /dev/sda3
  7678. @end example
  7679. Alternatively, you may use a swap file. For example, assuming that in the
  7680. new system you want to use the file @file{/swapfile} as a swap file, you
  7681. would run@footnote{This example will work for many types of file systems
  7682. (e.g., ext4). However, for copy-on-write file systems (e.g., btrfs), the
  7683. required steps may be different. For details, see the manual pages for
  7684. @command{mkswap} and @command{swapon}.}:
  7685. @example
  7686. # This is 10 GiB of swap space. Adjust "count" to change the size.
  7687. dd if=/dev/zero of=/mnt/swapfile bs=1MiB count=10240
  7688. # For security, make the file readable and writable only by root.
  7689. chmod 600 /mnt/swapfile
  7690. mkswap /mnt/swapfile
  7691. swapon /mnt/swapfile
  7692. @end example
  7693. Note that if you have encrypted the root partition and created a swap file
  7694. in its file system as described above, then the encryption also protects the
  7695. swap file, just like any other file in that file system.
  7696. @node Fortfahren mit der Installation
  7697. @subsection Fortfahren mit der Installation
  7698. With the target partitions ready and the target root mounted on @file{/mnt},
  7699. we're ready to go. First, run:
  7700. @example
  7701. herd start cow-store /mnt
  7702. @end example
  7703. This makes @file{/gnu/store} copy-on-write, such that packages added to it
  7704. during the installation phase are written to the target disk on @file{/mnt}
  7705. rather than kept in memory. This is necessary because the first phase of
  7706. the @command{guix system init} command (see below) entails downloads or
  7707. builds to @file{/gnu/store} which, initially, is an in-memory file system.
  7708. Next, you have to edit a file and provide the declaration of the operating
  7709. system to be installed. To that end, the installation system comes with
  7710. three text editors. We recommend GNU nano (@pxref{Top,,, nano, GNU nano
  7711. Manual}), which supports syntax highlighting and parentheses matching; other
  7712. editors include GNU Zile (an Emacs clone), and nvi (a clone of the original
  7713. BSD @command{vi} editor). We strongly recommend storing that file on the
  7714. target root file system, say, as @file{/mnt/etc/config.scm}. Failing to do
  7715. that, you will have lost your configuration file once you have rebooted into
  7716. the newly-installed system.
  7717. @xref{Das Konfigurationssystem nutzen}, for an overview of the configuration
  7718. file. The example configurations discussed in that section are available
  7719. under @file{/etc/configuration} in the installation image. Thus, to get
  7720. started with a system configuration providing a graphical display server (a
  7721. ``desktop'' system), you can run something along these lines:
  7722. @example
  7723. # mkdir /mnt/etc
  7724. # cp /etc/configuration/desktop.scm /mnt/etc/config.scm
  7725. # nano /mnt/etc/config.scm
  7726. @end example
  7727. You should pay attention to what your configuration file contains, and in
  7728. particular:
  7729. @itemize
  7730. @item
  7731. Make sure the @code{bootloader-configuration} form refers to the target you
  7732. want to install GRUB on. It should mention @code{grub-bootloader} if you
  7733. are installing GRUB in the legacy way, or @code{grub-efi-bootloader} for
  7734. newer UEFI systems. For legacy systems, the @code{target} field names a
  7735. device, like @code{/dev/sda}; for UEFI systems it names a path to a mounted
  7736. EFI partition, like @code{/boot/efi}, and do make sure the path is actually
  7737. mounted.
  7738. @item
  7739. Be sure that your file system labels match the value of their respective
  7740. @code{device} fields in your @code{file-system} configuration, assuming your
  7741. @code{file-system} configuration uses the @code{file-system-label} procedure
  7742. in its @code{device} field.
  7743. @item
  7744. If there are encrypted or RAID partitions, make sure to add a
  7745. @code{mapped-devices} field to describe them (@pxref{Abgebildete Geräte}).
  7746. @end itemize
  7747. Once you are done preparing the configuration file, the new system must be
  7748. initialized (remember that the target root file system is mounted under
  7749. @file{/mnt}):
  7750. @example
  7751. guix system init /mnt/etc/config.scm /mnt
  7752. @end example
  7753. @noindent
  7754. This copies all the necessary files and installs GRUB on @file{/dev/sdX},
  7755. unless you pass the @option{--no-bootloader} option. For more information,
  7756. @pxref{Aufruf von guix system}. This command may trigger downloads or builds
  7757. of missing packages, which can take some time.
  7758. Once that command has completed---and hopefully succeeded!---you can run
  7759. @command{reboot} and boot into the new system. The @code{root} password in
  7760. the new system is initially empty; other users' passwords need to be
  7761. initialized by running the @command{passwd} command as @code{root}, unless
  7762. your configuration specifies otherwise (@pxref{user-account-password, user
  7763. account passwords}).
  7764. @cindex upgrading GuixSD
  7765. From then on, you can update GuixSD whenever you want by running
  7766. @command{guix pull} as @code{root} (@pxref{Aufruf von guix pull}), and then
  7767. running @command{guix system reconfigure} to build a new system generation
  7768. with the latest packages and services (@pxref{Aufruf von guix system}). We
  7769. recommend doing that regularly so that your system includes the latest
  7770. security updates (@pxref{Sicherheitsaktualisierungen}).
  7771. Join us on @code{#guix} on the Freenode IRC network or on
  7772. @file{guix-devel@@gnu.org} to share your experience---good or not so good.
  7773. @node GuixSD in einer VM installieren
  7774. @subsection Installing GuixSD in a Virtual Machine
  7775. @cindex virtual machine, GuixSD installation
  7776. @cindex virtual private server (VPS)
  7777. @cindex VPS (virtual private server)
  7778. If you'd like to install GuixSD in a virtual machine (VM) or on a virtual
  7779. private server (VPS) rather than on your beloved machine, this section is
  7780. for you.
  7781. To boot a @uref{http://qemu.org/,QEMU} VM for installing GuixSD in a disk
  7782. image, follow these steps:
  7783. @enumerate
  7784. @item
  7785. First, retrieve and decompress the GuixSD installation image as described
  7786. previously (@pxref{Installation von USB-Stick oder DVD}).
  7787. @item
  7788. Create a disk image that will hold the installed system. To make a
  7789. qcow2-formatted disk image, use the @command{qemu-img} command:
  7790. @example
  7791. qemu-img create -f qcow2 guixsd.img 50G
  7792. @end example
  7793. The resulting file will be much smaller than 50 GB (typically less than 1
  7794. MB), but it will grow as the virtualized storage device is filled up.
  7795. @item
  7796. Boot the USB installation image in an VM:
  7797. @example
  7798. qemu-system-x86_64 -m 1024 -smp 1 \
  7799. -net user -net nic,model=virtio -boot menu=on \
  7800. -drive file=guixsd-install-@value{VERSION}.@var{system}.iso \
  7801. -drive file=guixsd.img
  7802. @end example
  7803. The ordering of the drives matters.
  7804. In the VM console, quickly press the @kbd{F12} key to enter the boot menu.
  7805. Then press the @kbd{2} key and the @kbd{RET} key to validate your selection.
  7806. @item
  7807. You're now root in the VM, proceed with the installation process.
  7808. @xref{Vor der Installation}, and follow the instructions.
  7809. @end enumerate
  7810. Once installation is complete, you can boot the system that's on your
  7811. @file{guixsd.img} image. @xref{GuixSD in einer VM starten}, for how to do that.
  7812. @node Ein Abbild zur Installation erstellen
  7813. @subsection Ein Abbild zur Installation erstellen
  7814. @cindex installation image
  7815. The installation image described above was built using the @command{guix
  7816. system} command, specifically:
  7817. @example
  7818. guix system disk-image gnu/system/install.scm
  7819. @end example
  7820. Have a look at @file{gnu/system/install.scm} in the source tree, and see
  7821. also @ref{Aufruf von guix system} for more information about the installation
  7822. image.
  7823. @subsection Building the Installation Image for ARM Boards
  7824. Many ARM boards require a specific variant of the
  7825. @uref{http://www.denx.de/wiki/U-Boot/, U-Boot} bootloader.
  7826. If you build a disk image and the bootloader is not available otherwise (on
  7827. another boot drive etc), it's advisable to build an image that includes the
  7828. bootloader, specifically:
  7829. @example
  7830. guix system disk-image --system=armhf-linux -e '((@@ (gnu system install) os-with-u-boot) (@@ (gnu system install) installation-os) "A20-OLinuXino-Lime2")'
  7831. @end example
  7832. @code{A20-OLinuXino-Lime2} is the name of the board. If you specify an
  7833. invalid board, a list of possible boards will be printed.
  7834. @node Systemkonfiguration
  7835. @section Systemkonfiguration
  7836. @cindex system configuration
  7837. The Guix System Distribution supports a consistent whole-system
  7838. configuration mechanism. By that we mean that all aspects of the global
  7839. system configuration---such as the available system services, timezone and
  7840. locale settings, user accounts---are declared in a single place. Such a
  7841. @dfn{system configuration} can be @dfn{instantiated}---i.e., effected.
  7842. @c Yes, we're talking of Puppet, Chef, & co. here. ↑
  7843. One of the advantages of putting all the system configuration under the
  7844. control of Guix is that it supports transactional system upgrades, and makes
  7845. it possible to roll back to a previous system instantiation, should
  7846. something go wrong with the new one (@pxref{Funktionalitäten}). Another advantage
  7847. is that it makes it easy to replicate the exact same configuration across
  7848. different machines, or at different points in time, without having to resort
  7849. to additional administration tools layered on top of the own tools of the
  7850. system.
  7851. This section describes this mechanism. First we focus on the system
  7852. administrator's viewpoint---explaining how the system is configured and
  7853. instantiated. Then we show how this mechanism can be extended, for instance
  7854. to support new system services.
  7855. @menu
  7856. * Das Konfigurationssystem nutzen:: Ihr GNU-System anpassen.
  7857. * „operating-system“-Referenz:: Details der
  7858. Betriebssystem-Deklarationen.
  7859. * Dateisysteme:: Die Dateisystemeinbindungen konfigurieren.
  7860. * Abgebildete Geräte:: Näheres zu blockorientierten Speichermedien.
  7861. * Benutzerkonten:: Benutzerkonten festlegen.
  7862. * Locales:: Sprache und kulturelle Konventionen.
  7863. * Dienste:: Systemdienste festlegen.
  7864. * Setuid-Programme:: Mit Administratorrechten startende Programme.
  7865. * X.509-Zertifikate:: HTTPS-Server authentifizieren.
  7866. * Name Service Switch:: Den Name Service Switch von libc konfigurieren.
  7867. * Initiale RAM-Disk:: Linux-libre hochfahren.
  7868. * Bootloader-Konfiguration:: Den Bootloader konfigurieren.
  7869. * Aufruf von guix system:: Instanzierung einer Systemkonfiguration.
  7870. * GuixSD in einer VM starten:: Wie man GuixSD in einer virtuellen Maschine
  7871. startet.
  7872. * Dienste definieren:: Neue Dienstdefinitionen hinzufügen.
  7873. @end menu
  7874. @node Das Konfigurationssystem nutzen
  7875. @subsection Das Konfigurationssystem nutzen
  7876. The operating system is configured by providing an @code{operating-system}
  7877. declaration in a file that can then be passed to the @command{guix system}
  7878. command (@pxref{Aufruf von guix system}). A simple setup, with the default
  7879. system services, the default Linux-Libre kernel, initial RAM disk, and boot
  7880. loader looks like this:
  7881. @findex operating-system
  7882. @lisp
  7883. @include os-config-bare-bones.texi
  7884. @end lisp
  7885. This example should be self-describing. Some of the fields defined above,
  7886. such as @code{host-name} and @code{bootloader}, are mandatory. Others, such
  7887. as @code{packages} and @code{services}, can be omitted, in which case they
  7888. get a default value.
  7889. Below we discuss the effect of some of the most important fields
  7890. (@pxref{„operating-system“-Referenz}, for details about all the available
  7891. fields), and how to @dfn{instantiate} the operating system using
  7892. @command{guix system}.
  7893. @unnumberedsubsubsec Bootloader
  7894. @cindex legacy boot, on Intel machines
  7895. @cindex BIOS boot, on Intel machines
  7896. @cindex UEFI boot
  7897. @cindex EFI boot
  7898. The @code{bootloader} field describes the method that will be used to boot
  7899. your system. Machines based on Intel processors can boot in ``legacy'' BIOS
  7900. mode, as in the example above. However, more recent machines rely instead
  7901. on the @dfn{Unified Extensible Firmware Interface} (UEFI) to boot. In that
  7902. case, the @code{bootloader} field should contain something along these
  7903. lines:
  7904. @example
  7905. (bootloader-configuration
  7906. (bootloader grub-efi-bootloader)
  7907. (target "/boot/efi"))
  7908. @end example
  7909. @xref{Bootloader-Konfiguration}, for more information on the available
  7910. configuration options.
  7911. @unnumberedsubsubsec Globally-Visible Packages
  7912. @vindex %base-packages
  7913. The @code{packages} field lists packages that will be globally visible on
  7914. the system, for all user accounts---i.e., in every user's @code{PATH}
  7915. environment variable---in addition to the per-user profiles (@pxref{Aufruf von guix package}). The @var{%base-packages} variable provides all the tools
  7916. one would expect for basic user and administrator tasks---including the GNU
  7917. Core Utilities, the GNU Networking Utilities, the GNU Zile lightweight text
  7918. editor, @command{find}, @command{grep}, etc. The example above adds
  7919. GNU@tie{}Screen to those, taken from the @code{(gnu packages screen)} module
  7920. (@pxref{Paketmodule}). The @code{(list package output)} syntax can be
  7921. used to add a specific output of a package:
  7922. @lisp
  7923. (use-modules (gnu packages))
  7924. (use-modules (gnu packages dns))
  7925. (operating-system
  7926. ;; ...
  7927. (packages (cons (list bind "utils")
  7928. %base-packages)))
  7929. @end lisp
  7930. @findex specification->package
  7931. Referring to packages by variable name, like @code{bind} above, has the
  7932. advantage of being unambiguous; it also allows typos and such to be
  7933. diagnosed right away as ``unbound variables''. The downside is that one
  7934. needs to know which module defines which package, and to augment the
  7935. @code{use-package-modules} line accordingly. To avoid that, one can use the
  7936. @code{specification->package} procedure of the @code{(gnu packages)} module,
  7937. which returns the best package for a given name or name and version:
  7938. @lisp
  7939. (use-modules (gnu packages))
  7940. (operating-system
  7941. ;; ...
  7942. (packages (append (map specification->package
  7943. '("tcpdump" "htop" "gnupg@@2.0"))
  7944. %base-packages)))
  7945. @end lisp
  7946. @unnumberedsubsubsec System Services
  7947. @cindex services
  7948. @vindex %base-services
  7949. The @code{services} field lists @dfn{system services} to be made available
  7950. when the system starts (@pxref{Dienste}). The @code{operating-system}
  7951. declaration above specifies that, in addition to the basic services, we want
  7952. the @command{lshd} secure shell daemon listening on port 2222
  7953. (@pxref{Netzwerkdienste, @code{lsh-service}}). Under the hood,
  7954. @code{lsh-service} arranges so that @code{lshd} is started with the right
  7955. command-line options, possibly with supporting configuration files generated
  7956. as needed (@pxref{Dienste definieren}).
  7957. @cindex customization, of services
  7958. @findex modify-services
  7959. Occasionally, instead of using the base services as is, you will want to
  7960. customize them. To do this, use @code{modify-services} (@pxref{Service-Referenz, @code{modify-services}}) to modify the list.
  7961. For example, suppose you want to modify @code{guix-daemon} and Mingetty (the
  7962. console log-in) in the @var{%base-services} list (@pxref{Basisdienste,
  7963. @code{%base-services}}). To do that, you can write the following in your
  7964. operating system declaration:
  7965. @lisp
  7966. (define %my-services
  7967. ;; My very own list of services.
  7968. (modify-services %base-services
  7969. (guix-service-type config =>
  7970. (guix-configuration
  7971. (inherit config)
  7972. (use-substitutes? #f)
  7973. (extra-options '("--gc-keep-derivations"))))
  7974. (mingetty-service-type config =>
  7975. (mingetty-configuration
  7976. (inherit config)))))
  7977. (operating-system
  7978. ;; @dots{}
  7979. (services %my-services))
  7980. @end lisp
  7981. This changes the configuration---i.e., the service parameters---of the
  7982. @code{guix-service-type} instance, and that of all the
  7983. @code{mingetty-service-type} instances in the @var{%base-services} list.
  7984. Observe how this is accomplished: first, we arrange for the original
  7985. configuration to be bound to the identifier @code{config} in the @var{body},
  7986. and then we write the @var{body} so that it evaluates to the desired
  7987. configuration. In particular, notice how we use @code{inherit} to create a
  7988. new configuration which has the same values as the old configuration, but
  7989. with a few modifications.
  7990. @cindex encrypted disk
  7991. The configuration for a typical ``desktop'' usage, with an encrypted root
  7992. partition, the X11 display server, GNOME and Xfce (users can choose which of
  7993. these desktop environments to use at the log-in screen by pressing
  7994. @kbd{F1}), network management, power management, and more, would look like
  7995. this:
  7996. @lisp
  7997. @include os-config-desktop.texi
  7998. @end lisp
  7999. A graphical system with a choice of lightweight window managers instead of
  8000. full-blown desktop environments would look like this:
  8001. @lisp
  8002. @include os-config-lightweight-desktop.texi
  8003. @end lisp
  8004. This example refers to the @file{/boot/efi} file system by its UUID,
  8005. @code{1234-ABCD}. Replace this UUID with the right UUID on your system, as
  8006. returned by the @command{blkid} command.
  8007. @xref{Desktop-Dienste}, for the exact list of services provided by
  8008. @var{%desktop-services}. @xref{X.509-Zertifikate}, for background
  8009. information about the @code{nss-certs} package that is used here.
  8010. Again, @var{%desktop-services} is just a list of service objects. If you
  8011. want to remove services from there, you can do so using the procedures for
  8012. list filtering (@pxref{SRFI-1 Filtering and Partitioning,,, guile, GNU Guile
  8013. Reference Manual}). For instance, the following expression returns a list
  8014. that contains all the services in @var{%desktop-services} minus the Avahi
  8015. service:
  8016. @example
  8017. (remove (lambda (service)
  8018. (eq? (service-kind service) avahi-service-type))
  8019. %desktop-services)
  8020. @end example
  8021. @unnumberedsubsubsec Instantiating the System
  8022. Assuming the @code{operating-system} declaration is stored in the
  8023. @file{my-system-config.scm} file, the @command{guix system reconfigure
  8024. my-system-config.scm} command instantiates that configuration, and makes it
  8025. the default GRUB boot entry (@pxref{Aufruf von guix system}).
  8026. The normal way to change the system configuration is by updating this file
  8027. and re-running @command{guix system reconfigure}. One should never have to
  8028. touch files in @file{/etc} or to run commands that modify the system state
  8029. such as @command{useradd} or @command{grub-install}. In fact, you must
  8030. avoid that since that would not only void your warranty but also prevent you
  8031. from rolling back to previous versions of your system, should you ever need
  8032. to.
  8033. @cindex roll-back, of the operating system
  8034. Speaking of roll-back, each time you run @command{guix system reconfigure},
  8035. a new @dfn{generation} of the system is created---without modifying or
  8036. deleting previous generations. Old system generations get an entry in the
  8037. bootloader boot menu, allowing you to boot them in case something went wrong
  8038. with the latest generation. Reassuring, no? The @command{guix system
  8039. list-generations} command lists the system generations available on disk.
  8040. It is also possible to roll back the system via the commands @command{guix
  8041. system roll-back} and @command{guix system switch-generation}.
  8042. Although the @command{guix system reconfigure} command will not modify
  8043. previous generations, you must take care when the current generation is not
  8044. the latest (e.g., after invoking @command{guix system roll-back}), since the
  8045. operation might overwrite a later generation (@pxref{Aufruf von guix system}).
  8046. @unnumberedsubsubsec The Programming Interface
  8047. At the Scheme level, the bulk of an @code{operating-system} declaration is
  8048. instantiated with the following monadic procedure (@pxref{Die Store-Monade}):
  8049. @deffn {Monadic Procedure} operating-system-derivation os
  8050. Return a derivation that builds @var{os}, an @code{operating-system} object
  8051. (@pxref{Ableitungen}).
  8052. The output of the derivation is a single directory that refers to all the
  8053. packages, configuration files, and other supporting files needed to
  8054. instantiate @var{os}.
  8055. @end deffn
  8056. This procedure is provided by the @code{(gnu system)} module. Along with
  8057. @code{(gnu services)} (@pxref{Dienste}), this module contains the guts of
  8058. GuixSD. Make sure to visit it!
  8059. @node „operating-system“-Referenz
  8060. @subsection @code{operating-system} Reference
  8061. This section summarizes all the options available in @code{operating-system}
  8062. declarations (@pxref{Das Konfigurationssystem nutzen}).
  8063. @deftp {Data Type} operating-system
  8064. This is the data type representing an operating system configuration. By
  8065. that, we mean all the global system configuration, not per-user
  8066. configuration (@pxref{Das Konfigurationssystem nutzen}).
  8067. @table @asis
  8068. @item @code{kernel} (default: @var{linux-libre})
  8069. The package object of the operating system kernel to use@footnote{Currently
  8070. only the Linux-libre kernel is supported. In the future, it will be
  8071. possible to use the GNU@tie{}Hurd.}.
  8072. @item @code{kernel-arguments} (default: @code{'()})
  8073. List of strings or gexps representing additional arguments to pass on the
  8074. command-line of the kernel---e.g., @code{("console=ttyS0")}.
  8075. @item @code{bootloader}
  8076. The system bootloader configuration object. @xref{Bootloader-Konfiguration}.
  8077. @item @code{initrd-modules} (default: @code{%base-initrd-modules})
  8078. @cindex initrd
  8079. @cindex initial RAM disk
  8080. The list of Linux kernel modules that need to be available in the initial
  8081. RAM disk. @xref{Initiale RAM-Disk}.
  8082. @item @code{initrd} (default: @code{base-initrd})
  8083. A procedure that returns an initial RAM disk for the Linux kernel. This
  8084. field is provided to support low-level customization and should rarely be
  8085. needed for casual use. @xref{Initiale RAM-Disk}.
  8086. @item @code{firmware} (default: @var{%base-firmware})
  8087. @cindex firmware
  8088. List of firmware packages loadable by the operating system kernel.
  8089. The default includes firmware needed for Atheros- and Broadcom-based WiFi
  8090. devices (Linux-libre modules @code{ath9k} and @code{b43-open},
  8091. respectively). @xref{Hardware-Überlegungen}, for more info on supported
  8092. hardware.
  8093. @item @code{host-name}
  8094. The host name.
  8095. @item @code{hosts-file}
  8096. @cindex hosts file
  8097. A file-like object (@pxref{G-Ausdrücke, file-like objects}) for use as
  8098. @file{/etc/hosts} (@pxref{Host Names,,, libc, The GNU C Library Reference
  8099. Manual}). The default is a file with entries for @code{localhost} and
  8100. @var{host-name}.
  8101. @item @code{mapped-devices} (default: @code{'()})
  8102. A list of mapped devices. @xref{Abgebildete Geräte}.
  8103. @item @code{file-systems}
  8104. A list of file systems. @xref{Dateisysteme}.
  8105. @item @code{swap-devices} (default: @code{'()})
  8106. @cindex swap devices
  8107. A list of strings identifying devices or files to be used for ``swap space''
  8108. (@pxref{Memory Concepts,,, libc, The GNU C Library Reference Manual}). For
  8109. example, @code{'("/dev/sda3")} or @code{'("/swapfile")}. It is possible to
  8110. specify a swap file in a file system on a mapped device, provided that the
  8111. necessary device mapping and file system are also specified. @xref{Abgebildete Geräte} and @ref{Dateisysteme}.
  8112. @item @code{users} (default: @code{%base-user-accounts})
  8113. @itemx @code{groups} (default: @var{%base-groups})
  8114. List of user accounts and groups. @xref{Benutzerkonten}.
  8115. If the @code{users} list lacks a user account with UID@tie{}0, a ``root''
  8116. account with UID@tie{}0 is automatically added.
  8117. @item @code{skeletons} (default: @code{(default-skeletons)})
  8118. A list target file name/file-like object tuples (@pxref{G-Ausdrücke,
  8119. file-like objects}). These are the skeleton files that will be added to the
  8120. home directory of newly-created user accounts.
  8121. For instance, a valid value may look like this:
  8122. @example
  8123. `((".bashrc" ,(plain-file "bashrc" "echo Hello\n"))
  8124. (".guile" ,(plain-file "guile"
  8125. "(use-modules (ice-9 readline))
  8126. (activate-readline)")))
  8127. @end example
  8128. @item @code{issue} (default: @var{%default-issue})
  8129. A string denoting the contents of the @file{/etc/issue} file, which is
  8130. displayed when users log in on a text console.
  8131. @item @code{packages} (default: @var{%base-packages})
  8132. The set of packages installed in the global profile, which is accessible at
  8133. @file{/run/current-system/profile}.
  8134. The default set includes core utilities and it is good practice to install
  8135. non-core utilities in user profiles (@pxref{Aufruf von guix package}).
  8136. @item @code{timezone}
  8137. A timezone identifying string---e.g., @code{"Europe/Paris"}.
  8138. You can run the @command{tzselect} command to find out which timezone string
  8139. corresponds to your region. Choosing an invalid timezone name causes
  8140. @command{guix system} to fail.
  8141. @item @code{locale} (default: @code{"en_US.utf8"})
  8142. The name of the default locale (@pxref{Locale Names,,, libc, The GNU C
  8143. Library Reference Manual}). @xref{Locales}, for more information.
  8144. @item @code{locale-definitions} (default: @var{%default-locale-definitions})
  8145. The list of locale definitions to be compiled and that may be used at run
  8146. time. @xref{Locales}.
  8147. @item @code{locale-libcs} (default: @code{(list @var{glibc})})
  8148. The list of GNU@tie{}libc packages whose locale data and tools are used to
  8149. build the locale definitions. @xref{Locales}, for compatibility
  8150. considerations that justify this option.
  8151. @item @code{name-service-switch} (default: @var{%default-nss})
  8152. Configuration of the libc name service switch (NSS)---a
  8153. @code{<name-service-switch>} object. @xref{Name Service Switch}, for
  8154. details.
  8155. @item @code{services} (default: @var{%base-services})
  8156. A list of service objects denoting system services. @xref{Dienste}.
  8157. @item @code{pam-services} (default: @code{(base-pam-services)})
  8158. @cindex PAM
  8159. @cindex pluggable authentication modules
  8160. @c FIXME: Add xref to PAM services section.
  8161. Linux @dfn{pluggable authentication module} (PAM) services.
  8162. @item @code{setuid-programs} (default: @var{%setuid-programs})
  8163. List of string-valued G-expressions denoting setuid programs. @xref{Setuid-Programme}.
  8164. @item @code{sudoers-file} (default: @var{%sudoers-specification})
  8165. @cindex sudoers file
  8166. The contents of the @file{/etc/sudoers} file as a file-like object
  8167. (@pxref{G-Ausdrücke, @code{local-file} and @code{plain-file}}).
  8168. This file specifies which users can use the @command{sudo} command, what
  8169. they are allowed to do, and what privileges they may gain. The default is
  8170. that only @code{root} and members of the @code{wheel} group may use
  8171. @code{sudo}.
  8172. @end table
  8173. @end deftp
  8174. @node Dateisysteme
  8175. @subsection Dateisysteme
  8176. The list of file systems to be mounted is specified in the
  8177. @code{file-systems} field of the operating system declaration (@pxref{Das Konfigurationssystem nutzen}). Each file system is declared using the
  8178. @code{file-system} form, like this:
  8179. @example
  8180. (file-system
  8181. (mount-point "/home")
  8182. (device "/dev/sda3")
  8183. (type "ext4"))
  8184. @end example
  8185. As usual, some of the fields are mandatory---those shown in the example
  8186. above---while others can be omitted. These are described below.
  8187. @deftp {Data Type} file-system
  8188. Objects of this type represent file systems to be mounted. They contain the
  8189. following members:
  8190. @table @asis
  8191. @item @code{type}
  8192. This is a string specifying the type of the file system---e.g.,
  8193. @code{"ext4"}.
  8194. @item @code{mount-point}
  8195. This designates the place where the file system is to be mounted.
  8196. @item @code{device}
  8197. This names the ``source'' of the file system. It can be one of three
  8198. things: a file system label, a file system UUID, or the name of a
  8199. @file{/dev} node. Labels and UUIDs offer a way to refer to file systems
  8200. without having to hard-code their actual device name@footnote{Note that,
  8201. while it is tempting to use @file{/dev/disk/by-uuid} and similar device
  8202. names to achieve the same result, this is not recommended: These special
  8203. device nodes are created by the udev daemon and may be unavailable at the
  8204. time the device is mounted.}.
  8205. @findex file-system-label
  8206. File system labels are created using the @code{file-system-label} procedure,
  8207. UUIDs are created using @code{uuid}, and @file{/dev} node are plain
  8208. strings. Here's an example of a file system referred to by its label, as
  8209. shown by the @command{e2label} command:
  8210. @example
  8211. (file-system
  8212. (mount-point "/home")
  8213. (type "ext4")
  8214. (device (file-system-label "my-home")))
  8215. @end example
  8216. @findex uuid
  8217. UUIDs are converted from their string representation (as shown by the
  8218. @command{tune2fs -l} command) using the @code{uuid} form@footnote{The
  8219. @code{uuid} form expects 16-byte UUIDs as defined in
  8220. @uref{https://tools.ietf.org/html/rfc4122, RFC@tie{}4122}. This is the form
  8221. of UUID used by the ext2 family of file systems and others, but it is
  8222. different from ``UUIDs'' found in FAT file systems, for instance.}, like
  8223. this:
  8224. @example
  8225. (file-system
  8226. (mount-point "/home")
  8227. (type "ext4")
  8228. (device (uuid "4dab5feb-d176-45de-b287-9b0a6e4c01cb")))
  8229. @end example
  8230. When the source of a file system is a mapped device (@pxref{Abgebildete Geräte}), its @code{device} field @emph{must} refer to the mapped device
  8231. name---e.g., @file{"/dev/mapper/root-partition"}. This is required so that
  8232. the system knows that mounting the file system depends on having the
  8233. corresponding device mapping established.
  8234. @item @code{flags} (default: @code{'()})
  8235. This is a list of symbols denoting mount flags. Recognized flags include
  8236. @code{read-only}, @code{bind-mount}, @code{no-dev} (disallow access to
  8237. special files), @code{no-suid} (ignore setuid and setgid bits), and
  8238. @code{no-exec} (disallow program execution.)
  8239. @item @code{options} (default: @code{#f})
  8240. This is either @code{#f}, or a string denoting mount options.
  8241. @item @code{mount?} (default: @code{#t})
  8242. This value indicates whether to automatically mount the file system when the
  8243. system is brought up. When set to @code{#f}, the file system gets an entry
  8244. in @file{/etc/fstab} (read by the @command{mount} command) but is not
  8245. automatically mounted.
  8246. @item @code{needed-for-boot?} (default: @code{#f})
  8247. This Boolean value indicates whether the file system is needed when
  8248. booting. If that is true, then the file system is mounted when the initial
  8249. RAM disk (initrd) is loaded. This is always the case, for instance, for the
  8250. root file system.
  8251. @item @code{check?} (default: @code{#t})
  8252. This Boolean indicates whether the file system needs to be checked for
  8253. errors before being mounted.
  8254. @item @code{create-mount-point?} (default: @code{#f})
  8255. When true, the mount point is created if it does not exist yet.
  8256. @item @code{dependencies} (default: @code{'()})
  8257. This is a list of @code{<file-system>} or @code{<mapped-device>} objects
  8258. representing file systems that must be mounted or mapped devices that must
  8259. be opened before (and unmounted or closed after) this one.
  8260. As an example, consider a hierarchy of mounts: @file{/sys/fs/cgroup} is a
  8261. dependency of @file{/sys/fs/cgroup/cpu} and @file{/sys/fs/cgroup/memory}.
  8262. Another example is a file system that depends on a mapped device, for
  8263. example for an encrypted partition (@pxref{Abgebildete Geräte}).
  8264. @end table
  8265. @end deftp
  8266. The @code{(gnu system file-systems)} exports the following useful variables.
  8267. @defvr {Scheme Variable} %base-file-systems
  8268. These are essential file systems that are required on normal systems, such
  8269. as @var{%pseudo-terminal-file-system} and @var{%immutable-store} (see
  8270. below.) Operating system declarations should always contain at least these.
  8271. @end defvr
  8272. @defvr {Scheme Variable} %pseudo-terminal-file-system
  8273. This is the file system to be mounted as @file{/dev/pts}. It supports
  8274. @dfn{pseudo-terminals} created @i{via} @code{openpty} and similar functions
  8275. (@pxref{Pseudo-Terminals,,, libc, The GNU C Library Reference Manual}).
  8276. Pseudo-terminals are used by terminal emulators such as @command{xterm}.
  8277. @end defvr
  8278. @defvr {Scheme Variable} %shared-memory-file-system
  8279. This file system is mounted as @file{/dev/shm} and is used to support memory
  8280. sharing across processes (@pxref{Memory-mapped I/O, @code{shm_open},, libc,
  8281. The GNU C Library Reference Manual}).
  8282. @end defvr
  8283. @defvr {Scheme Variable} %immutable-store
  8284. This file system performs a read-only ``bind mount'' of @file{/gnu/store},
  8285. making it read-only for all the users including @code{root}. This prevents
  8286. against accidental modification by software running as @code{root} or by
  8287. system administrators.
  8288. The daemon itself is still able to write to the store: it remounts it
  8289. read-write in its own ``name space.''
  8290. @end defvr
  8291. @defvr {Scheme Variable} %binary-format-file-system
  8292. The @code{binfmt_misc} file system, which allows handling of arbitrary
  8293. executable file types to be delegated to user space. This requires the
  8294. @code{binfmt.ko} kernel module to be loaded.
  8295. @end defvr
  8296. @defvr {Scheme Variable} %fuse-control-file-system
  8297. The @code{fusectl} file system, which allows unprivileged users to mount and
  8298. unmount user-space FUSE file systems. This requires the @code{fuse.ko}
  8299. kernel module to be loaded.
  8300. @end defvr
  8301. @node Abgebildete Geräte
  8302. @subsection Abgebildete Geräte
  8303. @cindex device mapping
  8304. @cindex mapped devices
  8305. The Linux kernel has a notion of @dfn{device mapping}: a block device, such
  8306. as a hard disk partition, can be @dfn{mapped} into another device, usually
  8307. in @code{/dev/mapper/}, with additional processing over the data that flows
  8308. through it@footnote{Note that the GNU@tie{}Hurd makes no difference between
  8309. the concept of a ``mapped device'' and that of a file system: both boil down
  8310. to @emph{translating} input/output operations made on a file to operations
  8311. on its backing store. Thus, the Hurd implements mapped devices, like file
  8312. systems, using the generic @dfn{translator} mechanism (@pxref{Translators,,,
  8313. hurd, The GNU Hurd Reference Manual}).}. A typical example is encryption
  8314. device mapping: all writes to the mapped device are encrypted, and all reads
  8315. are deciphered, transparently. Guix extends this notion by considering any
  8316. device or set of devices that are @dfn{transformed} in some way to create a
  8317. new device; for instance, RAID devices are obtained by @dfn{assembling}
  8318. several other devices, such as hard disks or partitions, into a new one that
  8319. behaves as one partition. Other examples, not yet implemented, are LVM
  8320. logical volumes.
  8321. Mapped devices are declared using the @code{mapped-device} form, defined as
  8322. follows; for examples, see below.
  8323. @deftp {Data Type} mapped-device
  8324. Objects of this type represent device mappings that will be made when the
  8325. system boots up.
  8326. @table @code
  8327. @item source
  8328. This is either a string specifying the name of the block device to be
  8329. mapped, such as @code{"/dev/sda3"}, or a list of such strings when several
  8330. devices need to be assembled for creating a new one.
  8331. @item target
  8332. This string specifies the name of the resulting mapped device. For kernel
  8333. mappers such as encrypted devices of type @code{luks-device-mapping},
  8334. specifying @code{"my-partition"} leads to the creation of the
  8335. @code{"/dev/mapper/my-partition"} device. For RAID devices of type
  8336. @code{raid-device-mapping}, the full device name such as @code{"/dev/md0"}
  8337. needs to be given.
  8338. @item type
  8339. This must be a @code{mapped-device-kind} object, which specifies how
  8340. @var{source} is mapped to @var{target}.
  8341. @end table
  8342. @end deftp
  8343. @defvr {Scheme Variable} luks-device-mapping
  8344. This defines LUKS block device encryption using the @command{cryptsetup}
  8345. command from the package with the same name. It relies on the
  8346. @code{dm-crypt} Linux kernel module.
  8347. @end defvr
  8348. @defvr {Scheme Variable} raid-device-mapping
  8349. This defines a RAID device, which is assembled using the @code{mdadm}
  8350. command from the package with the same name. It requires a Linux kernel
  8351. module for the appropriate RAID level to be loaded, such as @code{raid456}
  8352. for RAID-4, RAID-5 or RAID-6, or @code{raid10} for RAID-10.
  8353. @end defvr
  8354. @cindex disk encryption
  8355. @cindex LUKS
  8356. The following example specifies a mapping from @file{/dev/sda3} to
  8357. @file{/dev/mapper/home} using LUKS---the
  8358. @url{https://gitlab.com/cryptsetup/cryptsetup,Linux Unified Key Setup}, a
  8359. standard mechanism for disk encryption. The @file{/dev/mapper/home} device
  8360. can then be used as the @code{device} of a @code{file-system} declaration
  8361. (@pxref{Dateisysteme}).
  8362. @example
  8363. (mapped-device
  8364. (source "/dev/sda3")
  8365. (target "home")
  8366. (type luks-device-mapping))
  8367. @end example
  8368. Alternatively, to become independent of device numbering, one may obtain the
  8369. LUKS UUID (@dfn{unique identifier}) of the source device by a command like:
  8370. @example
  8371. cryptsetup luksUUID /dev/sda3
  8372. @end example
  8373. and use it as follows:
  8374. @example
  8375. (mapped-device
  8376. (source (uuid "cb67fc72-0d54-4c88-9d4b-b225f30b0f44"))
  8377. (target "home")
  8378. (type luks-device-mapping))
  8379. @end example
  8380. @cindex swap encryption
  8381. It is also desirable to encrypt swap space, since swap space may contain
  8382. sensitive data. One way to accomplish that is to use a swap file in a file
  8383. system on a device mapped via LUKS encryption. In this way, the swap file
  8384. is encrypted because the entire device is encrypted. @xref{Vor der Installation,,Disk Partitioning}, for an example.
  8385. A RAID device formed of the partitions @file{/dev/sda1} and @file{/dev/sdb1}
  8386. may be declared as follows:
  8387. @example
  8388. (mapped-device
  8389. (source (list "/dev/sda1" "/dev/sdb1"))
  8390. (target "/dev/md0")
  8391. (type raid-device-mapping))
  8392. @end example
  8393. The @file{/dev/md0} device can then be used as the @code{device} of a
  8394. @code{file-system} declaration (@pxref{Dateisysteme}). Note that the RAID
  8395. level need not be given; it is chosen during the initial creation and
  8396. formatting of the RAID device and is determined automatically later.
  8397. @node Benutzerkonten
  8398. @subsection Benutzerkonten
  8399. @cindex users
  8400. @cindex accounts
  8401. @cindex user accounts
  8402. User accounts and groups are entirely managed through the
  8403. @code{operating-system} declaration. They are specified with the
  8404. @code{user-account} and @code{user-group} forms:
  8405. @example
  8406. (user-account
  8407. (name "alice")
  8408. (group "users")
  8409. (supplementary-groups '("wheel" ;allow use of sudo, etc.
  8410. "audio" ;sound card
  8411. "video" ;video devices such as webcams
  8412. "cdrom")) ;the good ol' CD-ROM
  8413. (comment "Bob's sister")
  8414. (home-directory "/home/alice"))
  8415. @end example
  8416. When booting or upon completion of @command{guix system reconfigure}, the
  8417. system ensures that only the user accounts and groups specified in the
  8418. @code{operating-system} declaration exist, and with the specified
  8419. properties. Thus, account or group creations or modifications made by
  8420. directly invoking commands such as @command{useradd} are lost upon
  8421. reconfiguration or reboot. This ensures that the system remains exactly as
  8422. declared.
  8423. @deftp {Data Type} user-account
  8424. Objects of this type represent user accounts. The following members may be
  8425. specified:
  8426. @table @asis
  8427. @item @code{name}
  8428. The name of the user account.
  8429. @item @code{group}
  8430. @cindex groups
  8431. This is the name (a string) or identifier (a number) of the user group this
  8432. account belongs to.
  8433. @item @code{supplementary-groups} (default: @code{'()})
  8434. Optionally, this can be defined as a list of group names that this account
  8435. belongs to.
  8436. @item @code{uid} (default: @code{#f})
  8437. This is the user ID for this account (a number), or @code{#f}. In the
  8438. latter case, a number is automatically chosen by the system when the account
  8439. is created.
  8440. @item @code{comment} (default: @code{""})
  8441. A comment about the account, such as the account owner's full name.
  8442. @item @code{home-directory}
  8443. This is the name of the home directory for the account.
  8444. @item @code{create-home-directory?} (default: @code{#t})
  8445. Indicates whether the home directory of this account should be created if it
  8446. does not exist yet.
  8447. @item @code{shell} (default: Bash)
  8448. This is a G-expression denoting the file name of a program to be used as the
  8449. shell (@pxref{G-Ausdrücke}).
  8450. @item @code{system?} (default: @code{#f})
  8451. This Boolean value indicates whether the account is a ``system'' account.
  8452. System accounts are sometimes treated specially; for instance, graphical
  8453. login managers do not list them.
  8454. @anchor{user-account-password}
  8455. @item @code{password} (default: @code{#f})
  8456. You would normally leave this field to @code{#f}, initialize user passwords
  8457. as @code{root} with the @command{passwd} command, and then let users change
  8458. it with @command{passwd}. Passwords set with @command{passwd} are of course
  8459. preserved across reboot and reconfiguration.
  8460. If you @emph{do} want to have a preset password for an account, then this
  8461. field must contain the encrypted password, as a string. @xref{crypt,,,
  8462. libc, The GNU C Library Reference Manual}, for more information on password
  8463. encryption, and @ref{Encryption,,, guile, GNU Guile Reference Manual}, for
  8464. information on Guile's @code{crypt} procedure.
  8465. @end table
  8466. @end deftp
  8467. @cindex groups
  8468. User group declarations are even simpler:
  8469. @example
  8470. (user-group (name "students"))
  8471. @end example
  8472. @deftp {Data Type} user-group
  8473. This type is for, well, user groups. There are just a few fields:
  8474. @table @asis
  8475. @item @code{name}
  8476. The name of the group.
  8477. @item @code{id} (default: @code{#f})
  8478. The group identifier (a number). If @code{#f}, a new number is
  8479. automatically allocated when the group is created.
  8480. @item @code{system?} (default: @code{#f})
  8481. This Boolean value indicates whether the group is a ``system'' group.
  8482. System groups have low numerical IDs.
  8483. @item @code{password} (default: @code{#f})
  8484. What, user groups can have a password? Well, apparently yes. Unless
  8485. @code{#f}, this field specifies the password of the group.
  8486. @end table
  8487. @end deftp
  8488. For convenience, a variable lists all the basic user groups one may expect:
  8489. @defvr {Scheme Variable} %base-groups
  8490. This is the list of basic user groups that users and/or packages expect to
  8491. be present on the system. This includes groups such as ``root'', ``wheel'',
  8492. and ``users'', as well as groups used to control access to specific devices
  8493. such as ``audio'', ``disk'', and ``cdrom''.
  8494. @end defvr
  8495. @defvr {Scheme Variable} %base-user-accounts
  8496. This is the list of basic system accounts that programs may expect to find
  8497. on a GNU/Linux system, such as the ``nobody'' account.
  8498. Note that the ``root'' account is not included here. It is a special-case
  8499. and is automatically added whether or not it is specified.
  8500. @end defvr
  8501. @node Locales
  8502. @subsection Locales
  8503. @cindex locale
  8504. A @dfn{locale} defines cultural conventions for a particular language and
  8505. region of the world (@pxref{Locales,,, libc, The GNU C Library Reference
  8506. Manual}). Each locale has a name that typically has the form
  8507. @code{@var{language}_@var{territory}.@var{codeset}}---e.g.,
  8508. @code{fr_LU.utf8} designates the locale for the French language, with
  8509. cultural conventions from Luxembourg, and using the UTF-8 encoding.
  8510. @cindex locale definition
  8511. Usually, you will want to specify the default locale for the machine using
  8512. the @code{locale} field of the @code{operating-system} declaration
  8513. (@pxref{„operating-system“-Referenz, @code{locale}}).
  8514. The selected locale is automatically added to the @dfn{locale definitions}
  8515. known to the system if needed, with its codeset inferred from its
  8516. name---e.g., @code{bo_CN.utf8} will be assumed to use the @code{UTF-8}
  8517. codeset. Additional locale definitions can be specified in the
  8518. @code{locale-definitions} slot of @code{operating-system}---this is useful,
  8519. for instance, if the codeset could not be inferred from the locale name.
  8520. The default set of locale definitions includes some widely used locales, but
  8521. not all the available locales, in order to save space.
  8522. For instance, to add the North Frisian locale for Germany, the value of that
  8523. field may be:
  8524. @example
  8525. (cons (locale-definition
  8526. (name "fy_DE.utf8") (source "fy_DE"))
  8527. %default-locale-definitions)
  8528. @end example
  8529. Likewise, to save space, one might want @code{locale-definitions} to list
  8530. only the locales that are actually used, as in:
  8531. @example
  8532. (list (locale-definition
  8533. (name "ja_JP.eucjp") (source "ja_JP")
  8534. (charset "EUC-JP")))
  8535. @end example
  8536. @vindex LOCPATH
  8537. The compiled locale definitions are available at
  8538. @file{/run/current-system/locale/X.Y}, where @code{X.Y} is the libc version,
  8539. which is the default location where the GNU@tie{}libc provided by Guix looks
  8540. for locale data. This can be overridden using the @code{LOCPATH}
  8541. environment variable (@pxref{locales-and-locpath, @code{LOCPATH} and locale
  8542. packages}).
  8543. The @code{locale-definition} form is provided by the @code{(gnu system
  8544. locale)} module. Details are given below.
  8545. @deftp {Data Type} locale-definition
  8546. This is the data type of a locale definition.
  8547. @table @asis
  8548. @item @code{name}
  8549. The name of the locale. @xref{Locale Names,,, libc, The GNU C Library
  8550. Reference Manual}, for more information on locale names.
  8551. @item @code{source}
  8552. The name of the source for that locale. This is typically the
  8553. @code{@var{language}_@var{territory}} part of the locale name.
  8554. @item @code{charset} (default: @code{"UTF-8"})
  8555. The ``character set'' or ``code set'' for that locale,
  8556. @uref{http://www.iana.org/assignments/character-sets, as defined by IANA}.
  8557. @end table
  8558. @end deftp
  8559. @defvr {Scheme Variable} %default-locale-definitions
  8560. A list of commonly used UTF-8 locales, used as the default value of the
  8561. @code{locale-definitions} field of @code{operating-system} declarations.
  8562. @cindex locale name
  8563. @cindex normalized codeset in locale names
  8564. These locale definitions use the @dfn{normalized codeset} for the part that
  8565. follows the dot in the name (@pxref{Using gettextized software, normalized
  8566. codeset,, libc, The GNU C Library Reference Manual}). So for instance it
  8567. has @code{uk_UA.utf8} but @emph{not}, say, @code{uk_UA.UTF-8}.
  8568. @end defvr
  8569. @subsubsection Locale Data Compatibility Considerations
  8570. @cindex incompatibility, of locale data
  8571. @code{operating-system} declarations provide a @code{locale-libcs} field to
  8572. specify the GNU@tie{}libc packages that are used to compile locale
  8573. declarations (@pxref{„operating-system“-Referenz}). ``Why would I care?'',
  8574. you may ask. Well, it turns out that the binary format of locale data is
  8575. occasionally incompatible from one libc version to another.
  8576. @c See <https://sourceware.org/ml/libc-alpha/2015-09/msg00575.html>
  8577. @c and <https://lists.gnu.org/archive/html/guix-devel/2015-08/msg00737.html>.
  8578. For instance, a program linked against libc version 2.21 is unable to read
  8579. locale data produced with libc 2.22; worse, that program @emph{aborts}
  8580. instead of simply ignoring the incompatible locale data@footnote{Versions
  8581. 2.23 and later of GNU@tie{}libc will simply skip the incompatible locale
  8582. data, which is already an improvement.}. Similarly, a program linked
  8583. against libc 2.22 can read most, but not all, of the locale data from libc
  8584. 2.21 (specifically, @code{LC_COLLATE} data is incompatible); thus calls to
  8585. @code{setlocale} may fail, but programs will not abort.
  8586. The ``problem'' in GuixSD is that users have a lot of freedom: They can
  8587. choose whether and when to upgrade software in their profiles, and might be
  8588. using a libc version different from the one the system administrator used to
  8589. build the system-wide locale data.
  8590. Fortunately, unprivileged users can also install their own locale data and
  8591. define @var{GUIX_LOCPATH} accordingly (@pxref{locales-and-locpath,
  8592. @code{GUIX_LOCPATH} and locale packages}).
  8593. Still, it is best if the system-wide locale data at
  8594. @file{/run/current-system/locale} is built for all the libc versions
  8595. actually in use on the system, so that all the programs can access it---this
  8596. is especially crucial on a multi-user system. To do that, the administrator
  8597. can specify several libc packages in the @code{locale-libcs} field of
  8598. @code{operating-system}:
  8599. @example
  8600. (use-package-modules base)
  8601. (operating-system
  8602. ;; @dots{}
  8603. (locale-libcs (list glibc-2.21 (canonical-package glibc))))
  8604. @end example
  8605. This example would lead to a system containing locale definitions for both
  8606. libc 2.21 and the current version of libc in
  8607. @file{/run/current-system/locale}.
  8608. @node Dienste
  8609. @subsection Dienste
  8610. @cindex system services
  8611. An important part of preparing an @code{operating-system} declaration is
  8612. listing @dfn{system services} and their configuration (@pxref{Das Konfigurationssystem nutzen}). System services are typically daemons launched when
  8613. the system boots, or other actions needed at that time---e.g., configuring
  8614. network access.
  8615. GuixSD has a broad definition of ``service'' (@pxref{Dienstkompositionen}),
  8616. but many services are managed by the GNU@tie{}Shepherd (@pxref{Shepherd-Dienste}). On a running system, the @command{herd} command allows you to
  8617. list the available services, show their status, start and stop them, or do
  8618. other specific operations (@pxref{Jump Start,,, shepherd, The GNU Shepherd
  8619. Manual}). For example:
  8620. @example
  8621. # herd status
  8622. @end example
  8623. The above command, run as @code{root}, lists the currently defined
  8624. services. The @command{herd doc} command shows a synopsis of the given
  8625. service and its associated actions:
  8626. @example
  8627. # herd doc nscd
  8628. Run libc's name service cache daemon (nscd).
  8629. # herd doc nscd action invalidate
  8630. invalidate: Invalidate the given cache--e.g., 'hosts' for host name lookups.
  8631. @end example
  8632. The @command{start}, @command{stop}, and @command{restart} sub-commands have
  8633. the effect you would expect. For instance, the commands below stop the nscd
  8634. service and restart the Xorg display server:
  8635. @example
  8636. # herd stop nscd
  8637. Service nscd has been stopped.
  8638. # herd restart xorg-server
  8639. Service xorg-server has been stopped.
  8640. Service xorg-server has been started.
  8641. @end example
  8642. The following sections document the available services, starting with the
  8643. core services, that may be used in an @code{operating-system} declaration.
  8644. @menu
  8645. * Basisdienste:: Essenzielle Systemdienste.
  8646. * Geplante Auftragsausführung:: Der mcron-Dienst.
  8647. * Log-Rotation:: Der rottlog-Dienst.
  8648. * Netzwerkdienste:: Netzwerkeinrichtung, SSH-Daemon etc.
  8649. * X Window:: Graphische Anzeige.
  8650. * Druckdienste:: Unterstützung für lokale und entfernte
  8651. Drucker.
  8652. * Desktop-Dienste:: D-Bus- und Desktop-Dienste.
  8653. * Sound Services:: ALSA and Pulseaudio services.
  8654. * Datenbankdienste:: SQL-Datenbanken, Schlüssel-Wert-Speicher etc.
  8655. * Mail-Dienste:: IMAP, POP3, SMTP und so weiter.
  8656. * Kurznachrichtendienste:: Dienste für Kurznachrichten.
  8657. * Telefondienste:: Telefoniedienste.
  8658. * Überwachungsdienste:: Dienste zur Systemüberwachung.
  8659. * Kerberos-Dienste:: Kerberos-Dienste.
  8660. * Web-Dienste:: Web-Server.
  8661. * Zertifikatsdienste:: TLS-Zertifikate via Let’s Encrypt.
  8662. * DNS-Dienste:: DNS-Daemons.
  8663. * VPN-Dienste:: VPN-Daemons.
  8664. * Network File System:: Dienste mit Bezug zum Netzwerkdateisystem.
  8665. * Kontinuierliche Integration:: Der Cuirass-Dienst.
  8666. * Power Management Services:: Extending battery life.
  8667. * Audio-Dienste:: Der MPD.
  8668. * Virtualisierungsdienste:: Dienste für virtuelle Maschinen.
  8669. * Versionskontrolldienste:: Entfernten Zugang zu Git-Repositorys bieten.
  8670. * Spieldienste:: Spielserver.
  8671. * Verschiedene Dienste:: Andere Dienste.
  8672. @end menu
  8673. @node Basisdienste
  8674. @subsubsection Basisdienste
  8675. The @code{(gnu services base)} module provides definitions for the basic
  8676. services that one expects from the system. The services exported by this
  8677. module are listed below.
  8678. @defvr {Scheme Variable} %base-services
  8679. This variable contains a list of basic services (@pxref{Diensttypen und Dienste}, for more information on service objects) one would expect from
  8680. the system: a login service (mingetty) on each tty, syslogd, the libc name
  8681. service cache daemon (nscd), the udev device manager, and more.
  8682. This is the default value of the @code{services} field of
  8683. @code{operating-system} declarations. Usually, when customizing a system,
  8684. you will want to append services to @var{%base-services}, like this:
  8685. @example
  8686. (cons* (avahi-service) (lsh-service) %base-services)
  8687. @end example
  8688. @end defvr
  8689. @defvr {Scheme Variable} special-files-service-type
  8690. This is the service that sets up ``special files'' such as @file{/bin/sh};
  8691. an instance of it is part of @code{%base-services}.
  8692. The value associated with @code{special-files-service-type} services must be
  8693. a list of tuples where the first element is the ``special file'' and the
  8694. second element is its target. By default it is:
  8695. @cindex @file{/bin/sh}
  8696. @cindex @file{sh}, in @file{/bin}
  8697. @example
  8698. `(("/bin/sh" ,(file-append @var{bash} "/bin/sh")))
  8699. @end example
  8700. @cindex @file{/usr/bin/env}
  8701. @cindex @file{env}, in @file{/usr/bin}
  8702. If you want to add, say, @code{/usr/bin/env} to your system, you can change
  8703. it to:
  8704. @example
  8705. `(("/bin/sh" ,(file-append @var{bash} "/bin/sh"))
  8706. ("/usr/bin/env" ,(file-append @var{coreutils} "/bin/env")))
  8707. @end example
  8708. Since this is part of @code{%base-services}, you can use
  8709. @code{modify-services} to customize the set of special files (@pxref{Service-Referenz, @code{modify-services}}). But the simple way to add a special
  8710. file is @i{via} the @code{extra-special-file} procedure (see below.)
  8711. @end defvr
  8712. @deffn {Scheme Procedure} extra-special-file @var{file} @var{target}
  8713. Use @var{target} as the ``special file'' @var{file}.
  8714. For example, adding the following lines to the @code{services} field of your
  8715. operating system declaration leads to a @file{/usr/bin/env} symlink:
  8716. @example
  8717. (extra-special-file "/usr/bin/env"
  8718. (file-append coreutils "/bin/env"))
  8719. @end example
  8720. @end deffn
  8721. @deffn {Scheme Procedure} host-name-service @var{name}
  8722. Return a service that sets the host name to @var{name}.
  8723. @end deffn
  8724. @deffn {Scheme Procedure} login-service @var{config}
  8725. Return a service to run login according to @var{config}, a
  8726. @code{<login-configuration>} object, which specifies the message of the day,
  8727. among other things.
  8728. @end deffn
  8729. @deftp {Data Type} login-configuration
  8730. This is the data type representing the configuration of login.
  8731. @table @asis
  8732. @item @code{motd}
  8733. @cindex message of the day
  8734. A file-like object containing the ``message of the day''.
  8735. @item @code{allow-empty-passwords?} (default: @code{#t})
  8736. Allow empty passwords by default so that first-time users can log in when
  8737. the 'root' account has just been created.
  8738. @end table
  8739. @end deftp
  8740. @deffn {Scheme Procedure} mingetty-service @var{config}
  8741. Return a service to run mingetty according to @var{config}, a
  8742. @code{<mingetty-configuration>} object, which specifies the tty to run,
  8743. among other things.
  8744. @end deffn
  8745. @deftp {Data Type} mingetty-configuration
  8746. This is the data type representing the configuration of Mingetty, which
  8747. provides the default implementation of virtual console log-in.
  8748. @table @asis
  8749. @item @code{tty}
  8750. The name of the console this Mingetty runs on---e.g., @code{"tty1"}.
  8751. @item @code{auto-login} (default: @code{#f})
  8752. When true, this field must be a string denoting the user name under which
  8753. the system automatically logs in. When it is @code{#f}, a user name and
  8754. password must be entered to log in.
  8755. @item @code{login-program} (default: @code{#f})
  8756. This must be either @code{#f}, in which case the default log-in program is
  8757. used (@command{login} from the Shadow tool suite), or a gexp denoting the
  8758. name of the log-in program.
  8759. @item @code{login-pause?} (default: @code{#f})
  8760. When set to @code{#t} in conjunction with @var{auto-login}, the user will
  8761. have to press a key before the log-in shell is launched.
  8762. @item @code{mingetty} (default: @var{mingetty})
  8763. The Mingetty package to use.
  8764. @end table
  8765. @end deftp
  8766. @deffn {Scheme Procedure} agetty-service @var{config}
  8767. Return a service to run agetty according to @var{config}, an
  8768. @code{<agetty-configuration>} object, which specifies the tty to run, among
  8769. other things.
  8770. @end deffn
  8771. @deftp {Data Type} agetty-configuration
  8772. This is the data type representing the configuration of agetty, which
  8773. implements virtual and serial console log-in. See the @code{agetty(8)} man
  8774. page for more information.
  8775. @table @asis
  8776. @item @code{tty}
  8777. The name of the console this agetty runs on, as a string---e.g.,
  8778. @code{"ttyS0"}. This argument is optional, it will default to a reasonable
  8779. default serial port used by the kernel Linux.
  8780. For this, if there is a value for an option @code{agetty.tty} in the kernel
  8781. command line, agetty will extract the device name of the serial port from it
  8782. and use that.
  8783. If not and if there is a value for an option @code{console} with a tty in
  8784. the Linux command line, agetty will extract the device name of the serial
  8785. port from it and use that.
  8786. In both cases, agetty will leave the other serial device settings (baud rate
  8787. etc.)@: alone---in the hope that Linux pinned them to the correct values.
  8788. @item @code{baud-rate} (default: @code{#f})
  8789. A string containing a comma-separated list of one or more baud rates, in
  8790. descending order.
  8791. @item @code{term} (default: @code{#f})
  8792. A string containing the value used for the @code{TERM} environment variable.
  8793. @item @code{eight-bits?} (default: @code{#f})
  8794. When @code{#t}, the tty is assumed to be 8-bit clean, and parity detection
  8795. is disabled.
  8796. @item @code{auto-login} (default: @code{#f})
  8797. When passed a login name, as a string, the specified user will be logged in
  8798. automatically without prompting for their login name or password.
  8799. @item @code{no-reset?} (default: @code{#f})
  8800. When @code{#t}, don't reset terminal cflags (control modes).
  8801. @item @code{host} (default: @code{#f})
  8802. This accepts a string containing the "login_host", which will be written
  8803. into the @file{/var/run/utmpx} file.
  8804. @item @code{remote?} (default: @code{#f})
  8805. When set to @code{#t} in conjunction with @var{host}, this will add an
  8806. @code{-r} fakehost option to the command line of the login program specified
  8807. in @var{login-program}.
  8808. @item @code{flow-control?} (default: @code{#f})
  8809. When set to @code{#t}, enable hardware (RTS/CTS) flow control.
  8810. @item @code{no-issue?} (default: @code{#f})
  8811. When set to @code{#t}, the contents of the @file{/etc/issue} file will not
  8812. be displayed before presenting the login prompt.
  8813. @item @code{init-string} (default: @code{#f})
  8814. This accepts a string that will be sent to the tty or modem before sending
  8815. anything else. It can be used to initialize a modem.
  8816. @item @code{no-clear?} (default: @code{#f})
  8817. When set to @code{#t}, agetty will not clear the screen before showing the
  8818. login prompt.
  8819. @item @code{login-program} (default: (file-append shadow "/bin/login"))
  8820. This must be either a gexp denoting the name of a log-in program, or unset,
  8821. in which case the default value is the @command{login} from the Shadow tool
  8822. suite.
  8823. @item @code{local-line} (default: @code{#f})
  8824. Control the CLOCAL line flag. This accepts one of three symbols as
  8825. arguments, @code{'auto}, @code{'always}, or @code{'never}. If @code{#f}, the
  8826. default value chosen by agetty is @code{'auto}.
  8827. @item @code{extract-baud?} (default: @code{#f})
  8828. When set to @code{#t}, instruct agetty to try to extract the baud rate from
  8829. the status messages produced by certain types of modems.
  8830. @item @code{skip-login?} (default: @code{#f})
  8831. When set to @code{#t}, do not prompt the user for a login name. This can be
  8832. used with @var{login-program} field to use non-standard login systems.
  8833. @item @code{no-newline?} (default: @code{#f})
  8834. When set to @code{#t}, do not print a newline before printing the
  8835. @file{/etc/issue} file.
  8836. @c Is this dangerous only when used with login-program, or always?
  8837. @item @code{login-options} (default: @code{#f})
  8838. This option accepts a string containing options that are passed to the login
  8839. program. When used with the @var{login-program}, be aware that a malicious
  8840. user could try to enter a login name containing embedded options that could
  8841. be parsed by the login program.
  8842. @item @code{login-pause} (default: @code{#f})
  8843. When set to @code{#t}, wait for any key before showing the login prompt.
  8844. This can be used in conjunction with @var{auto-login} to save memory by
  8845. lazily spawning shells.
  8846. @item @code{chroot} (default: @code{#f})
  8847. Change root to the specified directory. This option accepts a directory
  8848. path as a string.
  8849. @item @code{hangup?} (default: @code{#f})
  8850. Use the Linux system call @code{vhangup} to do a virtual hangup of the
  8851. specified terminal.
  8852. @item @code{keep-baud?} (default: @code{#f})
  8853. When set to @code{#t}, try to keep the existing baud rate. The baud rates
  8854. from @var{baud-rate} are used when agetty receives a @key{BREAK} character.
  8855. @item @code{timeout} (default: @code{#f})
  8856. When set to an integer value, terminate if no user name could be read within
  8857. @var{timeout} seconds.
  8858. @item @code{detect-case?} (default: @code{#f})
  8859. When set to @code{#t}, turn on support for detecting an uppercase-only
  8860. terminal. This setting will detect a login name containing only uppercase
  8861. letters as indicating an uppercase-only terminal and turn on some
  8862. upper-to-lower case conversions. Note that this will not support Unicode
  8863. characters.
  8864. @item @code{wait-cr?} (default: @code{#f})
  8865. When set to @code{#t}, wait for the user or modem to send a carriage-return
  8866. or linefeed character before displaying @file{/etc/issue} or login prompt.
  8867. This is typically used with the @var{init-string} option.
  8868. @item @code{no-hints?} (default: @code{#f})
  8869. When set to @code{#t}, do not print hints about Num, Caps, and Scroll locks.
  8870. @item @code{no-hostname?} (default: @code{#f})
  8871. By default, the hostname is printed. When this option is set to @code{#t},
  8872. no hostname will be shown at all.
  8873. @item @code{long-hostname?} (default: @code{#f})
  8874. By default, the hostname is only printed until the first dot. When this
  8875. option is set to @code{#t}, the fully qualified hostname by
  8876. @code{gethostname} or @code{getaddrinfo} is shown.
  8877. @item @code{erase-characters} (default: @code{#f})
  8878. This option accepts a string of additional characters that should be
  8879. interpreted as backspace when the user types their login name.
  8880. @item @code{kill-characters} (default: @code{#f})
  8881. This option accepts a string that should be interpreted to mean "ignore all
  8882. previous characters" (also called a "kill" character) when the types their
  8883. login name.
  8884. @item @code{chdir} (default: @code{#f})
  8885. This option accepts, as a string, a directory path that will be changed to
  8886. before login.
  8887. @item @code{delay} (default: @code{#f})
  8888. This options accepts, as an integer, the number of seconds to sleep before
  8889. opening the tty and displaying the login prompt.
  8890. @item @code{nice} (default: @code{#f})
  8891. This option accepts, as an integer, the nice value with which to run the
  8892. @command{login} program.
  8893. @item @code{extra-options} (default: @code{'()})
  8894. This option provides an "escape hatch" for the user to provide arbitrary
  8895. command-line arguments to @command{agetty} as a list of strings.
  8896. @end table
  8897. @end deftp
  8898. @deffn {Scheme Procedure} kmscon-service-type @var{config}
  8899. Return a service to run
  8900. @uref{https://www.freedesktop.org/wiki/Software/kmscon,kmscon} according to
  8901. @var{config}, a @code{<kmscon-configuration>} object, which specifies the
  8902. tty to run, among other things.
  8903. @end deffn
  8904. @deftp {Data Type} kmscon-configuration
  8905. This is the data type representing the configuration of Kmscon, which
  8906. implements virtual console log-in.
  8907. @table @asis
  8908. @item @code{virtual-terminal}
  8909. The name of the console this Kmscon runs on---e.g., @code{"tty1"}.
  8910. @item @code{login-program} (default: @code{#~(string-append #$shadow "/bin/login")})
  8911. A gexp denoting the name of the log-in program. The default log-in program
  8912. is @command{login} from the Shadow tool suite.
  8913. @item @code{login-arguments} (default: @code{'("-p")})
  8914. A list of arguments to pass to @command{login}.
  8915. @item @code{auto-login} (default: @code{#f})
  8916. When passed a login name, as a string, the specified user will be logged in
  8917. automatically without prompting for their login name or password.
  8918. @item @code{hardware-acceleration?} (default: #f)
  8919. Whether to use hardware acceleration.
  8920. @item @code{kmscon} (default: @var{kmscon})
  8921. The Kmscon package to use.
  8922. @end table
  8923. @end deftp
  8924. @cindex name service cache daemon
  8925. @cindex nscd
  8926. @deffn {Scheme Procedure} nscd-service [@var{config}] [#:glibc glibc] @
  8927. [#:name-services '()] Return a service that runs the libc name service cache
  8928. daemon (nscd) with the given @var{config}---an @code{<nscd-configuration>}
  8929. object. @xref{Name Service Switch}, for an example.
  8930. For convenience, the Shepherd service for nscd provides the following
  8931. actions:
  8932. @table @code
  8933. @item invalidate
  8934. @cindex cache invalidation, nscd
  8935. @cindex nscd, cache invalidation
  8936. This invalidate the given cache. For instance, running:
  8937. @example
  8938. herd invalidate nscd hosts
  8939. @end example
  8940. @noindent
  8941. invalidates the host name lookup cache of nscd.
  8942. @item statistics
  8943. Running @command{herd statistics nscd} displays information about nscd usage
  8944. and caches.
  8945. @end table
  8946. @end deffn
  8947. @defvr {Scheme Variable} %nscd-default-configuration
  8948. This is the default @code{<nscd-configuration>} value (see below) used by
  8949. @code{nscd-service}. It uses the caches defined by
  8950. @var{%nscd-default-caches}; see below.
  8951. @end defvr
  8952. @deftp {Data Type} nscd-configuration
  8953. This is the data type representing the name service cache daemon (nscd)
  8954. configuration.
  8955. @table @asis
  8956. @item @code{name-services} (default: @code{'()})
  8957. List of packages denoting @dfn{name services} that must be visible to the
  8958. nscd---e.g., @code{(list @var{nss-mdns})}.
  8959. @item @code{glibc} (default: @var{glibc})
  8960. Package object denoting the GNU C Library providing the @command{nscd}
  8961. command.
  8962. @item @code{log-file} (default: @code{"/var/log/nscd.log"})
  8963. Name of the nscd log file. This is where debugging output goes when
  8964. @code{debug-level} is strictly positive.
  8965. @item @code{debug-level} (default: @code{0})
  8966. Integer denoting the debugging levels. Higher numbers mean that more
  8967. debugging output is logged.
  8968. @item @code{caches} (default: @var{%nscd-default-caches})
  8969. List of @code{<nscd-cache>} objects denoting things to be cached; see below.
  8970. @end table
  8971. @end deftp
  8972. @deftp {Data Type} nscd-cache
  8973. Data type representing a cache database of nscd and its parameters.
  8974. @table @asis
  8975. @item @code{database}
  8976. This is a symbol representing the name of the database to be cached. Valid
  8977. values are @code{passwd}, @code{group}, @code{hosts}, and @code{services},
  8978. which designate the corresponding NSS database (@pxref{NSS Basics,,, libc,
  8979. The GNU C Library Reference Manual}).
  8980. @item @code{positive-time-to-live}
  8981. @itemx @code{negative-time-to-live} (default: @code{20})
  8982. A number representing the number of seconds during which a positive or
  8983. negative lookup result remains in cache.
  8984. @item @code{check-files?} (default: @code{#t})
  8985. Whether to check for updates of the files corresponding to @var{database}.
  8986. For instance, when @var{database} is @code{hosts}, setting this flag
  8987. instructs nscd to check for updates in @file{/etc/hosts} and to take them
  8988. into account.
  8989. @item @code{persistent?} (default: @code{#t})
  8990. Whether the cache should be stored persistently on disk.
  8991. @item @code{shared?} (default: @code{#t})
  8992. Whether the cache should be shared among users.
  8993. @item @code{max-database-size} (default: 32@tie{}MiB)
  8994. Maximum size in bytes of the database cache.
  8995. @c XXX: 'suggested-size' and 'auto-propagate?' seem to be expert
  8996. @c settings, so leave them out.
  8997. @end table
  8998. @end deftp
  8999. @defvr {Scheme Variable} %nscd-default-caches
  9000. List of @code{<nscd-cache>} objects used by default by
  9001. @code{nscd-configuration} (see above).
  9002. It enables persistent and aggressive caching of service and host name
  9003. lookups. The latter provides better host name lookup performance,
  9004. resilience in the face of unreliable name servers, and also better
  9005. privacy---often the result of host name lookups is in local cache, so
  9006. external name servers do not even need to be queried.
  9007. @end defvr
  9008. @anchor{syslog-configuration-type}
  9009. @cindex syslog
  9010. @cindex logging
  9011. @deftp {Data Type} syslog-configuration
  9012. This data type represents the configuration of the syslog daemon.
  9013. @table @asis
  9014. @item @code{syslogd} (default: @code{#~(string-append #$inetutils "/libexec/syslogd")})
  9015. The syslog daemon to use.
  9016. @item @code{config-file} (default: @code{%default-syslog.conf})
  9017. The syslog configuration file to use.
  9018. @end table
  9019. @end deftp
  9020. @anchor{syslog-service}
  9021. @cindex syslog
  9022. @deffn {Scheme Procedure} syslog-service @var{config}
  9023. Return a service that runs a syslog daemon according to @var{config}.
  9024. @xref{syslogd invocation,,, inetutils, GNU Inetutils}, for more information
  9025. on the configuration file syntax.
  9026. @end deffn
  9027. @defvr {Scheme Variable} guix-service-type
  9028. This is the type of the service that runs the build daemon,
  9029. @command{guix-daemon} (@pxref{Aufruf des guix-daemon}). Its value must be a
  9030. @code{guix-configuration} record as described below.
  9031. @end defvr
  9032. @anchor{guix-configuration-type}
  9033. @deftp {Data Type} guix-configuration
  9034. This data type represents the configuration of the Guix build daemon.
  9035. @xref{Aufruf des guix-daemon}, for more information.
  9036. @table @asis
  9037. @item @code{guix} (default: @var{guix})
  9038. The Guix package to use.
  9039. @item @code{build-group} (default: @code{"guixbuild"})
  9040. Name of the group for build user accounts.
  9041. @item @code{build-accounts} (default: @code{10})
  9042. Number of build user accounts to create.
  9043. @item @code{authorize-key?} (default: @code{#t})
  9044. @cindex Substitute, deren Autorisierung
  9045. Whether to authorize the substitute keys listed in
  9046. @code{authorized-keys}---by default that of @code{hydra.gnu.org}
  9047. (@pxref{Substitute}).
  9048. @vindex %default-authorized-guix-keys
  9049. @item @code{authorized-keys} (default: @var{%default-authorized-guix-keys})
  9050. The list of authorized key files for archive imports, as a list of
  9051. string-valued gexps (@pxref{Aufruf von guix archive}). By default, it
  9052. contains that of @code{hydra.gnu.org} (@pxref{Substitute}).
  9053. @item @code{use-substitutes?} (default: @code{#t})
  9054. Whether to use substitutes.
  9055. @item @code{substitute-urls} (default: @var{%default-substitute-urls})
  9056. The list of URLs where to look for substitutes by default.
  9057. @item @code{max-silent-time} (default: @code{0})
  9058. @itemx @code{timeout} (default: @code{0})
  9059. The number of seconds of silence and the number of seconds of activity,
  9060. respectively, after which a build process times out. A value of zero
  9061. disables the timeout.
  9062. @item @code{log-compression} (default: @code{'bzip2})
  9063. The type of compression used for build logs---one of @code{gzip},
  9064. @code{bzip2}, or @code{none}.
  9065. @item @code{extra-options} (default: @code{'()})
  9066. List of extra command-line options for @command{guix-daemon}.
  9067. @item @code{log-file} (default: @code{"/var/log/guix-daemon.log"})
  9068. File where @command{guix-daemon}'s standard output and standard error are
  9069. written.
  9070. @item @code{http-proxy} (default: @code{#f})
  9071. The HTTP proxy used for downloading fixed-output derivations and
  9072. substitutes.
  9073. @item @code{tmpdir} (default: @code{#f})
  9074. A directory path where the @command{guix-daemon} will perform builds.
  9075. @end table
  9076. @end deftp
  9077. @deffn {Scheme Procedure} udev-service [#:udev @var{eudev} #:rules @code{'()}]
  9078. Run @var{udev}, which populates the @file{/dev} directory dynamically. udev
  9079. rules can be provided as a list of files through the @var{rules} variable.
  9080. The procedures @var{udev-rule} and @var{file->udev-rule} from @code{(gnu
  9081. services base)} simplify the creation of such rule files.
  9082. @deffn {Scheme Procedure} udev-rule [@var{file-name} @var{contents}]
  9083. Return a udev-rule file named @var{file-name} containing the rules defined
  9084. by the @var{contents} literal.
  9085. In the following example, a rule for a USB device is defined to be stored in
  9086. the file @file{90-usb-thing.rules}. The rule runs a script upon detecting a
  9087. USB device with a given product identifier.
  9088. @example
  9089. (define %example-udev-rule
  9090. (udev-rule
  9091. "90-usb-thing.rules"
  9092. (string-append "ACTION==\"add\", SUBSYSTEM==\"usb\", "
  9093. "ATTR@{product@}==\"Example\", "
  9094. "RUN+=\"/path/to/script\"")))
  9095. @end example
  9096. @end deffn
  9097. Here we show how the default @var{udev-service} can be extended with it.
  9098. @example
  9099. (operating-system
  9100. ;; @dots{}
  9101. (services
  9102. (modify-services %desktop-services
  9103. (udev-service-type config =>
  9104. (udev-configuration (inherit config)
  9105. (rules (append (udev-configuration-rules config)
  9106. (list %example-udev-rule))))))))
  9107. @end example
  9108. @deffn {Scheme Procedure} file->udev-rule [@var{file-name} @var{file}]
  9109. Return a udev file named @var{file-name} containing the rules defined within
  9110. @var{file}, a file-like object.
  9111. The following example showcases how we can use an existing rule file.
  9112. @example
  9113. (use-modules (guix download) ;for url-fetch
  9114. (guix packages) ;for origin
  9115. ;; @dots{})
  9116. (define %android-udev-rules
  9117. (file->udev-rule
  9118. "51-android-udev.rules"
  9119. (let ((version "20170910"))
  9120. (origin
  9121. (method url-fetch)
  9122. (uri (string-append "https://raw.githubusercontent.com/M0Rf30/"
  9123. "android-udev-rules/" version "/51-android.rules"))
  9124. (sha256
  9125. (base32 "0lmmagpyb6xsq6zcr2w1cyx9qmjqmajkvrdbhjx32gqf1d9is003"))))))
  9126. @end example
  9127. @end deffn
  9128. Additionally, Guix package definitions can be included in @var{rules} in
  9129. order to extend the udev rules with the definitions found under their
  9130. @file{lib/udev/rules.d} sub-directory. In lieu of the previous
  9131. @var{file->udev-rule} example, we could have used the
  9132. @var{android-udev-rules} package which exists in Guix in the @code{(gnu
  9133. packages android)} module.
  9134. The following example shows how to use the @var{android-udev-rules} package
  9135. so that the Android tool @command{adb} can detect devices without root
  9136. privileges. It also details how to create the @code{adbusers} group, which
  9137. is required for the proper functioning of the rules defined within the
  9138. @var{android-udev-rules} package. To create such a group, we must define it
  9139. both as part of the @var{supplementary-groups} of our @var{user-account}
  9140. declaration, as well as in the @var{groups} field of the
  9141. @var{operating-system} record.
  9142. @example
  9143. (use-modules (gnu packages android) ;for android-udev-rules
  9144. (gnu system shadow) ;for user-group
  9145. ;; @dots{})
  9146. (operating-system
  9147. ;; @dots{}
  9148. (users (cons (user-acount
  9149. ;; @dots{}
  9150. (supplementary-groups
  9151. '("adbusers" ;for adb
  9152. "wheel" "netdev" "audio" "video"))
  9153. ;; @dots{})))
  9154. (groups (cons (user-group (system? #t) (name "adbusers"))
  9155. %base-groups))
  9156. ;; @dots{}
  9157. (services
  9158. (modify-services %desktop-services
  9159. (udev-service-type config =>
  9160. (udev-configuration (inherit config)
  9161. (rules (cons* android-udev-rules
  9162. (udev-configuration-rules config))))))))
  9163. @end example
  9164. @end deffn
  9165. @defvr {Scheme Variable} urandom-seed-service-type
  9166. Save some entropy in @var{%random-seed-file} to seed @file{/dev/urandom}
  9167. when rebooting. It also tries to seed @file{/dev/urandom} from
  9168. @file{/dev/hwrng} while booting, if @file{/dev/hwrng} exists and is
  9169. readable.
  9170. @end defvr
  9171. @defvr {Scheme Variable} %random-seed-file
  9172. This is the name of the file where some random bytes are saved by
  9173. @var{urandom-seed-service} to seed @file{/dev/urandom} when rebooting. It
  9174. defaults to @file{/var/lib/random-seed}.
  9175. @end defvr
  9176. @cindex keymap
  9177. @cindex keyboard
  9178. @deffn {Scheme Procedure} console-keymap-service @var{files} ...
  9179. @cindex keyboard layout
  9180. Return a service to load console keymaps from @var{files} using
  9181. @command{loadkeys} command. Most likely, you want to load some default
  9182. keymap, which can be done like this:
  9183. @example
  9184. (console-keymap-service "dvorak")
  9185. @end example
  9186. Or, for example, for a Swedish keyboard, you may need to combine the
  9187. following keymaps:
  9188. @example
  9189. (console-keymap-service "se-lat6" "se-fi-lat6")
  9190. @end example
  9191. Also you can specify a full file name (or file names) of your keymap(s).
  9192. See @code{man loadkeys} for details.
  9193. @end deffn
  9194. @cindex mouse
  9195. @cindex gpm
  9196. @defvr {Scheme Variable} gpm-service-type
  9197. This is the type of the service that runs GPM, the @dfn{general-purpose
  9198. mouse daemon}, which provides mouse support to the Linux console. GPM
  9199. allows users to use the mouse in the console, notably to select, copy, and
  9200. paste text.
  9201. The value for services of this type must be a @code{gpm-configuration} (see
  9202. below). This service is not part of @var{%base-services}.
  9203. @end defvr
  9204. @deftp {Data Type} gpm-configuration
  9205. Data type representing the configuration of GPM.
  9206. @table @asis
  9207. @item @code{options} (default: @code{%default-gpm-options})
  9208. Command-line options passed to @command{gpm}. The default set of options
  9209. instruct @command{gpm} to listen to mouse events on @file{/dev/input/mice}.
  9210. @xref{Command Line,,, gpm, gpm manual}, for more information.
  9211. @item @code{gpm} (default: @code{gpm})
  9212. The GPM package to use.
  9213. @end table
  9214. @end deftp
  9215. @anchor{guix-publish-service-type}
  9216. @deffn {Scheme Variable} guix-publish-service-type
  9217. This is the service type for @command{guix publish} (@pxref{Aufruf von guix publish}). Its value must be a @code{guix-configuration} object, as
  9218. described below.
  9219. This assumes that @file{/etc/guix} already contains a signing key pair as
  9220. created by @command{guix archive --generate-key} (@pxref{Aufruf von guix archive}). If that is not the case, the service will fail to start.
  9221. @end deffn
  9222. @deftp {Data Type} guix-publish-configuration
  9223. Data type representing the configuration of the @code{guix publish} service.
  9224. @table @asis
  9225. @item @code{guix} (default: @code{guix})
  9226. The Guix package to use.
  9227. @item @code{port} (default: @code{80})
  9228. The TCP port to listen for connections.
  9229. @item @code{host} (default: @code{"localhost"})
  9230. The host (and thus, network interface) to listen to. Use @code{"0.0.0.0"}
  9231. to listen on all the network interfaces.
  9232. @item @code{compression-level} (Vorgabe: @code{3})
  9233. The gzip compression level at which substitutes are compressed. Use
  9234. @code{0} to disable compression altogether, and @code{9} to get the best
  9235. compression ratio at the expense of increased CPU usage.
  9236. @item @code{nar-path} (default: @code{"nar"})
  9237. The URL path at which ``nars'' can be fetched. @xref{Aufruf von guix publish,
  9238. @code{--nar-path}}, for details.
  9239. @item @code{cache} (default: @code{#f})
  9240. When it is @code{#f}, disable caching and instead generate archives on
  9241. demand. Otherwise, this should be the name of a directory---e.g.,
  9242. @code{"/var/cache/guix/publish"}---where @command{guix publish} caches
  9243. archives and meta-data ready to be sent. @xref{Aufruf von guix publish,
  9244. @option{--cache}}, for more information on the tradeoffs involved.
  9245. @item @code{workers} (default: @code{#f})
  9246. When it is an integer, this is the number of worker threads used for
  9247. caching; when @code{#f}, the number of processors is used. @xref{Aufruf von guix publish, @option{--workers}}, for more information.
  9248. @item @code{ttl} (default: @code{#f})
  9249. When it is an integer, this denotes the @dfn{time-to-live} in seconds of the
  9250. published archives. @xref{Aufruf von guix publish, @option{--ttl}}, for more
  9251. information.
  9252. @end table
  9253. @end deftp
  9254. @anchor{rngd-service}
  9255. @deffn {Scheme Procedure} rngd-service [#:rng-tools @var{rng-tools}] @
  9256. [#:device "/dev/hwrng"] Return a service that runs the @command{rngd}
  9257. program from @var{rng-tools} to add @var{device} to the kernel's entropy
  9258. pool. The service will fail if @var{device} does not exist.
  9259. @end deffn
  9260. @anchor{pam-limits-service}
  9261. @cindex session limits
  9262. @cindex ulimit
  9263. @cindex priority
  9264. @cindex realtime
  9265. @cindex jackd
  9266. @deffn {Scheme Procedure} pam-limits-service [#:limits @code{'()}]
  9267. Return a service that installs a configuration file for the
  9268. @uref{http://linux-pam.org/Linux-PAM-html/sag-pam_limits.html,
  9269. @code{pam_limits} module}. The procedure optionally takes a list of
  9270. @code{pam-limits-entry} values, which can be used to specify @code{ulimit}
  9271. limits and nice priority limits to user sessions.
  9272. The following limits definition sets two hard and soft limits for all login
  9273. sessions of users in the @code{realtime} group:
  9274. @example
  9275. (pam-limits-service
  9276. (list
  9277. (pam-limits-entry "@@realtime" 'both 'rtprio 99)
  9278. (pam-limits-entry "@@realtime" 'both 'memlock 'unlimited)))
  9279. @end example
  9280. The first entry increases the maximum realtime priority for non-privileged
  9281. processes; the second entry lifts any restriction of the maximum address
  9282. space that can be locked in memory. These settings are commonly used for
  9283. real-time audio systems.
  9284. @end deffn
  9285. @node Geplante Auftragsausführung
  9286. @subsubsection Geplante Auftragsausführung
  9287. @cindex cron
  9288. @cindex mcron
  9289. @cindex scheduling jobs
  9290. The @code{(gnu services mcron)} module provides an interface to
  9291. GNU@tie{}mcron, a daemon to run jobs at scheduled times (@pxref{Top,,,
  9292. mcron, GNU@tie{}mcron}). GNU@tie{}mcron is similar to the traditional Unix
  9293. @command{cron} daemon; the main difference is that it is implemented in
  9294. Guile Scheme, which provides a lot of flexibility when specifying the
  9295. scheduling of jobs and their actions.
  9296. The example below defines an operating system that runs the
  9297. @command{updatedb} (@pxref{Invoking updatedb,,, find, Finding Files}) and
  9298. the @command{guix gc} commands (@pxref{Aufruf von guix gc}) daily, as well as
  9299. the @command{mkid} command on behalf of an unprivileged user (@pxref{mkid
  9300. invocation,,, idutils, ID Database Utilities}). It uses gexps to introduce
  9301. job definitions that are passed to mcron (@pxref{G-Ausdrücke}).
  9302. @lisp
  9303. (use-modules (guix) (gnu) (gnu services mcron))
  9304. (use-package-modules base idutils)
  9305. (define updatedb-job
  9306. ;; Run 'updatedb' at 3AM every day. Here we write the
  9307. ;; job's action as a Scheme procedure.
  9308. #~(job '(next-hour '(3))
  9309. (lambda ()
  9310. (execl (string-append #$findutils "/bin/updatedb")
  9311. "updatedb"
  9312. "--prunepaths=/tmp /var/tmp /gnu/store"))))
  9313. (define garbage-collector-job
  9314. ;; Collect garbage 5 minutes after midnight every day.
  9315. ;; The job's action is a shell command.
  9316. #~(job "5 0 * * *" ;Vixie cron syntax
  9317. "guix gc -F 1G"))
  9318. (define idutils-job
  9319. ;; Update the index database as user "charlie" at 12:15PM
  9320. ;; and 19:15PM. This runs from the user's home directory.
  9321. #~(job '(next-minute-from (next-hour '(12 19)) '(15))
  9322. (string-append #$idutils "/bin/mkid src")
  9323. #:user "charlie"))
  9324. (operating-system
  9325. ;; @dots{}
  9326. (services (cons (mcron-service (list garbage-collector-job
  9327. updatedb-job
  9328. idutils-job))
  9329. %base-services)))
  9330. @end lisp
  9331. @xref{Guile Syntax, mcron job specifications,, mcron, GNU@tie{}mcron}, for
  9332. more information on mcron job specifications. Below is the reference of the
  9333. mcron service.
  9334. On a running system, you can use the @code{schedule} action of the service
  9335. to visualize the mcron jobs that will be executed next:
  9336. @example
  9337. # herd schedule mcron
  9338. @end example
  9339. @noindent
  9340. The example above lists the next five tasks that will be executed, but you
  9341. can also specify the number of tasks to display:
  9342. @example
  9343. # herd schedule mcron 10
  9344. @end example
  9345. @deffn {Scheme Procedure} mcron-service @var{jobs} [#:mcron @var{mcron}]
  9346. Return an mcron service running @var{mcron} that schedules @var{jobs}, a
  9347. list of gexps denoting mcron job specifications.
  9348. This is a shorthand for:
  9349. @example
  9350. (service mcron-service-type
  9351. (mcron-configuration (mcron mcron) (jobs jobs)))
  9352. @end example
  9353. @end deffn
  9354. @defvr {Scheme Variable} mcron-service-type
  9355. This is the type of the @code{mcron} service, whose value is an
  9356. @code{mcron-configuration} object.
  9357. This service type can be the target of a service extension that provides it
  9358. additional job specifications (@pxref{Dienstkompositionen}). In other
  9359. words, it is possible to define services that provide additional mcron jobs
  9360. to run.
  9361. @end defvr
  9362. @deftp {Data Type} mcron-configuration
  9363. Data type representing the configuration of mcron.
  9364. @table @asis
  9365. @item @code{mcron} (default: @var{mcron})
  9366. The mcron package to use.
  9367. @item @code{jobs}
  9368. This is a list of gexps (@pxref{G-Ausdrücke}), where each gexp corresponds
  9369. to an mcron job specification (@pxref{Syntax, mcron job specifications,,
  9370. mcron, GNU@tie{}mcron}).
  9371. @end table
  9372. @end deftp
  9373. @node Log-Rotation
  9374. @subsubsection Log-Rotation
  9375. @cindex rottlog
  9376. @cindex log rotation
  9377. @cindex logging
  9378. Log files such as those found in @file{/var/log} tend to grow endlessly, so
  9379. it's a good idea to @dfn{rotate} them once in a while---i.e., archive their
  9380. contents in separate files, possibly compressed. The @code{(gnu services
  9381. admin)} module provides an interface to GNU@tie{}Rot[t]log, a log rotation
  9382. tool (@pxref{Top,,, rottlog, GNU Rot[t]log Manual}).
  9383. The example below defines an operating system that provides log rotation
  9384. with the default settings, for commonly encountered log files.
  9385. @lisp
  9386. (use-modules (guix) (gnu))
  9387. (use-service-modules admin mcron)
  9388. (use-package-modules base idutils)
  9389. (operating-system
  9390. ;; @dots{}
  9391. (services (cons (service rottlog-service-type)
  9392. %base-services)))
  9393. @end lisp
  9394. @defvr {Scheme Variable} rottlog-service-type
  9395. This is the type of the Rottlog service, whose value is a
  9396. @code{rottlog-configuration} object.
  9397. Other services can extend this one with new @code{log-rotation} objects (see
  9398. below), thereby augmenting the set of files to be rotated.
  9399. This service type can define mcron jobs (@pxref{Geplante Auftragsausführung}) to
  9400. run the rottlog service.
  9401. @end defvr
  9402. @deftp {Data Type} rottlog-configuration
  9403. Data type representing the configuration of rottlog.
  9404. @table @asis
  9405. @item @code{rottlog} (default: @code{rottlog})
  9406. The Rottlog package to use.
  9407. @item @code{rc-file} (default: @code{(file-append rottlog "/etc/rc")})
  9408. The Rottlog configuration file to use (@pxref{Mandatory RC Variables,,,
  9409. rottlog, GNU Rot[t]log Manual}).
  9410. @item @code{rotations} (default: @code{%default-rotations})
  9411. A list of @code{log-rotation} objects as defined below.
  9412. @item @code{jobs}
  9413. This is a list of gexps where each gexp corresponds to an mcron job
  9414. specification (@pxref{Geplante Auftragsausführung}).
  9415. @end table
  9416. @end deftp
  9417. @deftp {Data Type} log-rotation
  9418. Data type representing the rotation of a group of log files.
  9419. Taking an example from the Rottlog manual (@pxref{Period Related File
  9420. Examples,,, rottlog, GNU Rot[t]log Manual}), a log rotation might be defined
  9421. like this:
  9422. @example
  9423. (log-rotation
  9424. (frequency 'daily)
  9425. (files '("/var/log/apache/*"))
  9426. (options '("storedir apache-archives"
  9427. "rotate 6"
  9428. "notifempty"
  9429. "nocompress")))
  9430. @end example
  9431. The list of fields is as follows:
  9432. @table @asis
  9433. @item @code{frequency} (default: @code{'weekly})
  9434. The log rotation frequency, a symbol.
  9435. @item @code{files}
  9436. The list of files or file glob patterns to rotate.
  9437. @item @code{options} (default: @code{'()})
  9438. The list of rottlog options for this rotation (@pxref{Configuration
  9439. parameters,,, rottlog, GNU Rot[t]lg Manual}).
  9440. @item @code{post-rotate} (default: @code{#f})
  9441. Either @code{#f} or a gexp to execute once the rotation has completed.
  9442. @end table
  9443. @end deftp
  9444. @defvr {Scheme Variable} %default-rotations
  9445. Specifies weekly rotation of @var{%rotated-files} and a couple of other
  9446. files.
  9447. @end defvr
  9448. @defvr {Scheme Variable} %rotated-files
  9449. The list of syslog-controlled files to be rotated. By default it is:
  9450. @code{'("/var/log/messages" "/var/log/secure")}.
  9451. @end defvr
  9452. @node Netzwerkdienste
  9453. @subsubsection Netzwerkdienste
  9454. The @code{(gnu services networking)} module provides services to configure
  9455. the network interface.
  9456. @cindex DHCP, networking service
  9457. @defvr {Scheme Variable} dhcp-client-service-type
  9458. This is the type of services that run @var{dhcp}, a Dynamic Host
  9459. Configuration Protocol (DHCP) client, on all the non-loopback network
  9460. interfaces. Its value is the DHCP client package to use, @code{isc-dhcp} by
  9461. default.
  9462. @end defvr
  9463. @deffn {Scheme Procedure} dhcpd-service-type
  9464. This type defines a service that runs a DHCP daemon. To create a service of
  9465. this type, you must supply a @code{<dhcpd-configuration>}. For example:
  9466. @example
  9467. (service dhcpd-service-type
  9468. (dhcpd-configuration
  9469. (config-file (local-file "my-dhcpd.conf"))
  9470. (interfaces '("enp0s25"))))
  9471. @end example
  9472. @end deffn
  9473. @deftp {Data Type} dhcpd-configuration
  9474. @table @asis
  9475. @item @code{package} (default: @code{isc-dhcp})
  9476. The package that provides the DHCP daemon. This package is expected to
  9477. provide the daemon at @file{sbin/dhcpd} relative to its output directory.
  9478. The default package is the @uref{http://www.isc.org/products/DHCP, ISC's
  9479. DHCP server}.
  9480. @item @code{config-file} (default: @code{#f})
  9481. The configuration file to use. This is required. It will be passed to
  9482. @code{dhcpd} via its @code{-cf} option. This may be any ``file-like''
  9483. object (@pxref{G-Ausdrücke, file-like objects}). See @code{man
  9484. dhcpd.conf} for details on the configuration file syntax.
  9485. @item @code{version} (default: @code{"4"})
  9486. The DHCP version to use. The ISC DHCP server supports the values ``4'',
  9487. ``6'', and ``4o6''. These correspond to the @code{dhcpd} program options
  9488. @code{-4}, @code{-6}, and @code{-4o6}. See @code{man dhcpd} for details.
  9489. @item @code{run-directory} (default: @code{"/run/dhcpd"})
  9490. The run directory to use. At service activation time, this directory will
  9491. be created if it does not exist.
  9492. @item @code{pid-file} (default: @code{"/run/dhcpd/dhcpd.pid"})
  9493. The PID file to use. This corresponds to the @code{-pf} option of
  9494. @code{dhcpd}. See @code{man dhcpd} for details.
  9495. @item @code{interfaces} (default: @code{'()})
  9496. The names of the network interfaces on which dhcpd should listen for
  9497. broadcasts. If this list is not empty, then its elements (which must be
  9498. strings) will be appended to the @code{dhcpd} invocation when starting the
  9499. daemon. It may not be necessary to explicitly specify any interfaces here;
  9500. see @code{man dhcpd} for details.
  9501. @end table
  9502. @end deftp
  9503. @defvr {Scheme Variable} static-networking-service-type
  9504. @c TODO Document <static-networking> data structures.
  9505. This is the type for statically-configured network interfaces.
  9506. @end defvr
  9507. @deffn {Scheme Procedure} static-networking-service @var{interface} @var{ip} @
  9508. [#:netmask #f] [#:gateway #f] [#:name-servers @code{'()}] @ [#:requirement
  9509. @code{'(udev)}] Return a service that starts @var{interface} with address
  9510. @var{ip}. If @var{netmask} is true, use it as the network mask. If
  9511. @var{gateway} is true, it must be a string specifying the default network
  9512. gateway. @var{requirement} can be used to declare a dependency on another
  9513. service before configuring the interface.
  9514. This procedure can be called several times, one for each network interface
  9515. of interest. Behind the scenes what it does is extend
  9516. @code{static-networking-service-type} with additional network interfaces to
  9517. handle.
  9518. For example:
  9519. @example
  9520. (static-networking-service "eno1" "192.168.1.82"
  9521. #:gateway "192.168.1.2"
  9522. #:name-servers '("192.168.1.2"))
  9523. @end example
  9524. @end deffn
  9525. @cindex wicd
  9526. @cindex wireless
  9527. @cindex WiFi
  9528. @cindex network management
  9529. @deffn {Scheme Procedure} wicd-service [#:wicd @var{wicd}]
  9530. Return a service that runs @url{https://launchpad.net/wicd,Wicd}, a network
  9531. management daemon that aims to simplify wired and wireless networking.
  9532. This service adds the @var{wicd} package to the global profile, providing
  9533. several commands to interact with the daemon and configure networking:
  9534. @command{wicd-client}, a graphical user interface, and the
  9535. @command{wicd-cli} and @command{wicd-curses} user interfaces.
  9536. @end deffn
  9537. @cindex ModemManager
  9538. @defvr {Scheme Variable} modem-manager-service-type
  9539. This is the service type for the
  9540. @uref{https://wiki.gnome.org/Projects/ModemManager, ModemManager}
  9541. service. The value for this service type is a
  9542. @code{modem-manager-configuration} record.
  9543. This service is part of @code{%desktop-services} (@pxref{Desktop-Dienste}).
  9544. @end defvr
  9545. @deftp {Data Type} modem-manager-configuration
  9546. Data type representing the configuration of ModemManager.
  9547. @table @asis
  9548. @item @code{modem-manager} (default: @code{modem-manager})
  9549. The ModemManager package to use.
  9550. @end table
  9551. @end deftp
  9552. @cindex NetworkManager
  9553. @defvr {Scheme Variable} network-manager-service-type
  9554. This is the service type for the
  9555. @uref{https://wiki.gnome.org/Projects/NetworkManager, NetworkManager}
  9556. service. The value for this service type is a
  9557. @code{network-manager-configuration} record.
  9558. This service is part of @code{%desktop-services} (@pxref{Desktop-Dienste}).
  9559. @end defvr
  9560. @deftp {Data Type} network-manager-configuration
  9561. Data type representing the configuration of NetworkManager.
  9562. @table @asis
  9563. @item @code{network-manager} (default: @code{network-manager})
  9564. The NetworkManager package to use.
  9565. @item @code{dns} (default: @code{"default"})
  9566. Processing mode for DNS, which affects how NetworkManager uses the
  9567. @code{resolv.conf} configuration file.
  9568. @table @samp
  9569. @item default
  9570. NetworkManager will update @code{resolv.conf} to reflect the nameservers
  9571. provided by currently active connections.
  9572. @item dnsmasq
  9573. NetworkManager will run @code{dnsmasq} as a local caching nameserver, using
  9574. a "split DNS" configuration if you are connected to a VPN, and then update
  9575. @code{resolv.conf} to point to the local nameserver.
  9576. @item none
  9577. NetworkManager will not modify @code{resolv.conf}.
  9578. @end table
  9579. @item @code{vpn-plugins} (default: @code{'()})
  9580. This is the list of available plugins for virtual private networks (VPNs).
  9581. An example of this is the @code{network-manager-openvpn} package, which
  9582. allows NetworkManager to manage VPNs @i{via} OpenVPN.
  9583. @end table
  9584. @end deftp
  9585. @cindex Connman
  9586. @deffn {Scheme Variable} connman-service-type
  9587. This is the service type to run @url{https://01.org/connman,Connman}, a
  9588. network connection manager.
  9589. Its value must be an @code{connman-configuration} record as in this example:
  9590. @example
  9591. (service connman-service-type
  9592. (connman-configuration
  9593. (disable-vpn? #t)))
  9594. @end example
  9595. See below for details about @code{connman-configuration}.
  9596. @end deffn
  9597. @deftp {Data Type} connman-configuration
  9598. Data Type representing the configuration of connman.
  9599. @table @asis
  9600. @item @code{connman} (default: @var{connman})
  9601. The connman package to use.
  9602. @item @code{disable-vpn?} (default: @code{#f})
  9603. When true, disable connman's vpn plugin.
  9604. @end table
  9605. @end deftp
  9606. @cindex WPA Supplicant
  9607. @defvr {Scheme Variable} wpa-supplicant-service-type
  9608. This is the service type to run @url{https://w1.fi/wpa_supplicant/,WPA
  9609. supplicant}, an authentication daemon required to authenticate against
  9610. encrypted WiFi or ethernet networks.
  9611. @end defvr
  9612. @deftp {Data Type} wpa-supplicant-configuration
  9613. Data type representing the configuration of WPA Supplicant.
  9614. It takes the following parameters:
  9615. @table @asis
  9616. @item @code{wpa-supplicant} (default: @code{wpa-supplicant})
  9617. The WPA Supplicant package to use.
  9618. @item @code{dbus?} (default: @code{#t})
  9619. Whether to listen for requests on D-Bus.
  9620. @item @code{pid-file} (default: @code{"/var/run/wpa_supplicant.pid"})
  9621. Where to store the PID file.
  9622. @item @code{interface} (default: @code{#f})
  9623. If this is set, it must specify the name of a network interface that WPA
  9624. supplicant will control.
  9625. @item @code{config-file} (default: @code{#f})
  9626. Optional configuration file to use.
  9627. @item @code{extra-options} (default: @code{'()})
  9628. List of additional command-line arguments to pass to the daemon.
  9629. @end table
  9630. @end deftp
  9631. @cindex iptables
  9632. @defvr {Scheme Variable} iptables-service-type
  9633. This is the service type to set up an iptables configuration. iptables is a
  9634. packet filtering framework supported by the Linux kernel. This service
  9635. supports configuring iptables for both IPv4 and IPv6. A simple example
  9636. configuration rejecting all incoming connections except those to the ssh
  9637. port 22 is shown below.
  9638. @lisp
  9639. (service iptables-service-type
  9640. (iptables-configuration
  9641. (ipv4-rules (plain-file "iptables.rules" "*filter
  9642. :INPUT ACCEPT
  9643. :FORWARD ACCEPT
  9644. :OUTPUT ACCEPT
  9645. -A INPUT -p tcp --dport 22 -j ACCEPT
  9646. -A INPUT -j REJECT --reject-with icmp-port-unreachable
  9647. COMMIT
  9648. "))
  9649. (ipv6-rules (plain-file "ip6tables.rules" "*filter
  9650. :INPUT ACCEPT
  9651. :FORWARD ACCEPT
  9652. :OUTPUT ACCEPT
  9653. -A INPUT -p tcp --dport 22 -j ACCEPT
  9654. -A INPUT -j REJECT --reject-with icmp6-port-unreachable
  9655. COMMIT
  9656. "))))
  9657. @end lisp
  9658. @end defvr
  9659. @deftp {Data Type} iptables-configuration
  9660. The data type representing the configuration of iptables.
  9661. @table @asis
  9662. @item @code{iptables} (default: @code{iptables})
  9663. The iptables package that provides @code{iptables-restore} and
  9664. @code{ip6tables-restore}.
  9665. @item @code{ipv4-rules} (default: @code{%iptables-accept-all-rules})
  9666. The iptables rules to use. It will be passed to @code{iptables-restore}.
  9667. This may be any ``file-like'' object (@pxref{G-Ausdrücke, file-like
  9668. objects}).
  9669. @item @code{ipv6-rules} (default: @code{%iptables-accept-all-rules})
  9670. The ip6tables rules to use. It will be passed to @code{ip6tables-restore}.
  9671. This may be any ``file-like'' object (@pxref{G-Ausdrücke, file-like
  9672. objects}).
  9673. @end table
  9674. @end deftp
  9675. @cindex NTP (Network Time Protocol), service
  9676. @cindex real time clock
  9677. @defvr {Scheme Variable} ntp-service-type
  9678. This is the type of the service running the @uref{http://www.ntp.org,
  9679. Network Time Protocol (NTP)} daemon, @command{ntpd}. The daemon will keep
  9680. the system clock synchronized with that of the specified NTP servers.
  9681. The value of this service is an @code{ntpd-configuration} object, as
  9682. described below.
  9683. @end defvr
  9684. @deftp {Data Type} ntp-configuration
  9685. This is the data type for the NTP service configuration.
  9686. @table @asis
  9687. @item @code{servers} (default: @code{%ntp-servers})
  9688. This is the list of servers (host names) with which @command{ntpd} will be
  9689. synchronized.
  9690. @item @code{allow-large-adjustment?} (default: @code{#f})
  9691. This determines whether @command{ntpd} is allowed to make an initial
  9692. adjustment of more than 1,000 seconds.
  9693. @item @code{ntp} (default: @code{ntp})
  9694. The NTP package to use.
  9695. @end table
  9696. @end deftp
  9697. @defvr {Scheme Variable} %ntp-servers
  9698. List of host names used as the default NTP servers. These are servers of
  9699. the @uref{https://www.ntppool.org/en/, NTP Pool Project}.
  9700. @end defvr
  9701. @cindex OpenNTPD
  9702. @deffn {Scheme Procedure} openntpd-service-type
  9703. Run the @command{ntpd}, the Network Time Protocol (NTP) daemon, as
  9704. implemented by @uref{http://www.openntpd.org, OpenNTPD}. The daemon will
  9705. keep the system clock synchronized with that of the given servers.
  9706. @example
  9707. (service
  9708. openntpd-service-type
  9709. (openntpd-configuration
  9710. (listen-on '("127.0.0.1" "::1"))
  9711. (sensor '("udcf0 correction 70000"))
  9712. (constraint-from '("www.gnu.org"))
  9713. (constraints-from '("https://www.google.com/"))
  9714. (allow-large-adjustment? #t)))
  9715. @end example
  9716. @end deffn
  9717. @deftp {Data Type} openntpd-configuration
  9718. @table @asis
  9719. @item @code{openntpd} (default: @code{(file-append openntpd "/sbin/ntpd")})
  9720. The openntpd executable to use.
  9721. @item @code{listen-on} (default: @code{'("127.0.0.1" "::1")})
  9722. A list of local IP addresses or hostnames the ntpd daemon should listen on.
  9723. @item @code{query-from} (default: @code{'()})
  9724. A list of local IP address the ntpd daemon should use for outgoing queries.
  9725. @item @code{sensor} (default: @code{'()})
  9726. Specify a list of timedelta sensor devices ntpd should use. @code{ntpd}
  9727. will listen to each sensor that acutally exists and ignore non-existant
  9728. ones. See @uref{https://man.openbsd.org/ntpd.conf, upstream documentation}
  9729. for more information.
  9730. @item @code{server} (default: @var{%ntp-servers})
  9731. Specify a list of IP addresses or hostnames of NTP servers to synchronize
  9732. to.
  9733. @item @code{servers} (default: @code{'()})
  9734. Specify a list of IP addresses or hostnames of NTP pools to synchronize to.
  9735. @item @code{constraint-from} (default: @code{'()})
  9736. @code{ntpd} can be configured to query the ‘Date’ from trusted HTTPS servers
  9737. via TLS. This time information is not used for precision but acts as an
  9738. authenticated constraint, thereby reducing the impact of unauthenticated NTP
  9739. man-in-the-middle attacks. Specify a list of URLs, IP addresses or
  9740. hostnames of HTTPS servers to provide a constraint.
  9741. @item @code{constraints-from} (default: @code{'()})
  9742. As with constraint from, specify a list of URLs, IP addresses or hostnames
  9743. of HTTPS servers to provide a constraint. Should the hostname resolve to
  9744. multiple IP addresses, @code{ntpd} will calculate a median constraint from
  9745. all of them.
  9746. @item @code{allow-large-adjustment?} (default: @code{#f})
  9747. Determines if @code{ntpd} is allowed to make an initial adjustment of more
  9748. than 180 seconds.
  9749. @end table
  9750. @end deftp
  9751. @cindex inetd
  9752. @deffn {Scheme variable} inetd-service-type
  9753. This service runs the @command{inetd} (@pxref{inetd invocation,,, inetutils,
  9754. GNU Inetutils}) daemon. @command{inetd} listens for connections on internet
  9755. sockets, and lazily starts the specified server program when a connection is
  9756. made on one of these sockets.
  9757. The value of this service is an @code{inetd-configuration} object. The
  9758. following example configures the @command{inetd} daemon to provide the
  9759. built-in @command{echo} service, as well as an smtp service which forwards
  9760. smtp traffic over ssh to a server @code{smtp-server} behind a gateway
  9761. @code{hostname}:
  9762. @example
  9763. (service
  9764. inetd-service-type
  9765. (inetd-configuration
  9766. (entries (list
  9767. (inetd-entry
  9768. (name "echo")
  9769. (socket-type 'stream)
  9770. (protocol "tcp")
  9771. (wait? #f)
  9772. (user "root"))
  9773. (inetd-entry
  9774. (node "127.0.0.1")
  9775. (name "smtp")
  9776. (socket-type 'stream)
  9777. (protocol "tcp")
  9778. (wait? #f)
  9779. (user "root")
  9780. (program (file-append openssh "/bin/ssh"))
  9781. (arguments
  9782. '("ssh" "-qT" "-i" "/path/to/ssh_key"
  9783. "-W" "smtp-server:25" "user@@hostname")))))
  9784. @end example
  9785. See below for more details about @code{inetd-configuration}.
  9786. @end deffn
  9787. @deftp {Data Type} inetd-configuration
  9788. Data type representing the configuration of @command{inetd}.
  9789. @table @asis
  9790. @item @code{program} (default: @code{(file-append inetutils "/libexec/inetd")})
  9791. The @command{inetd} executable to use.
  9792. @item @code{entries} (default: @code{'()})
  9793. A list of @command{inetd} service entries. Each entry should be created by
  9794. the @code{inetd-entry} constructor.
  9795. @end table
  9796. @end deftp
  9797. @deftp {Data Type} inetd-entry
  9798. Data type representing an entry in the @command{inetd} configuration. Each
  9799. entry corresponds to a socket where @command{inetd} will listen for
  9800. requests.
  9801. @table @asis
  9802. @item @code{node} (Vorgabe: @code{#f})
  9803. Optional string, a comma-separated list of local addresses @command{inetd}
  9804. should use when listening for this service. @xref{Configuration file,,,
  9805. inetutils, GNU Inetutils} for a complete description of all options.
  9806. @item @code{name}
  9807. A string, the name must correspond to an entry in @code{/etc/services}.
  9808. @item @code{socket-type}
  9809. One of @code{'stream}, @code{'dgram}, @code{'raw}, @code{'rdm} or
  9810. @code{'seqpacket}.
  9811. @item @code{protocol}
  9812. A string, must correspond to an entry in @code{/etc/protocols}.
  9813. @item @code{wait?} (Vorgabe: @code{#t})
  9814. Whether @command{inetd} should wait for the server to exit before listening
  9815. to new service requests.
  9816. @item @code{user}
  9817. A string containing the user (and, optionally, group) name of the user as
  9818. whom the server should run. The group name can be specified in a suffix,
  9819. separated by a colon or period, i.e.@: @code{"user"}, @code{"user:group"} or
  9820. @code{"user.group"}.
  9821. @item @code{program} (default: @code{"internal"})
  9822. The server program which will serve the requests, or @code{"internal"} if
  9823. @command{inetd} should use a built-in service.
  9824. @item @code{arguments} (default: @code{'()})
  9825. A list strings or file-like objects, which are the server program's
  9826. arguments, starting with the zeroth argument, i.e.@: the name of the program
  9827. itself. For @command{inetd}'s internal services, this entry must be
  9828. @code{'()} or @code{'("internal")}.
  9829. @end table
  9830. @xref{Configuration file,,, inetutils, GNU Inetutils} for a more detailed
  9831. discussion of each configuration field.
  9832. @end deftp
  9833. @cindex Tor
  9834. @defvr {Scheme Variable} tor-service-type
  9835. This is the type for a service that runs the @uref{https://torproject.org,
  9836. Tor} anonymous networking daemon. The service is configured using a
  9837. @code{<tor-configuration>} record. By default, the Tor daemon runs as the
  9838. @code{tor} unprivileged user, which is a member of the @code{tor} group.
  9839. @end defvr
  9840. @deffn {Scheme Procedure} tor-service [@var{config-file}] [#:tor @var{tor}]
  9841. This procedure is deprecated and will be removed in a future release.
  9842. Return a service of the @code{tor-service-type} type. @var{config-file} and
  9843. @var{tor} have the same meaning as in @code{<tor-configuration>}.
  9844. @end deffn
  9845. @deftp {Data Type} tor-configuration
  9846. @table @asis
  9847. @item @code{tor} (default: @code{tor})
  9848. The package that provides the Tor daemon. This package is expected to
  9849. provide the daemon at @file{bin/tor} relative to its output directory. The
  9850. default package is the @uref{https://www.torproject.org, Tor Project's}
  9851. implementation.
  9852. @item @code{config-file} (default: @code{(plain-file "empty" "")})
  9853. The configuration file to use. It will be appended to a default
  9854. configuration file, and the final configuration file will be passed to
  9855. @code{tor} via its @code{-f} option. This may be any ``file-like'' object
  9856. (@pxref{G-Ausdrücke, file-like objects}). See @code{man tor} for details
  9857. on the configuration file syntax.
  9858. @item @code{hidden-services} (default: @code{'()})
  9859. The list of @code{<hidden-service>} records to use. For any hidden service
  9860. you include in this list, appropriate configuration to enable the hidden
  9861. service will be automatically added to the default configuration file. You
  9862. may conveniently create @code{<hidden-service>} records using the
  9863. @code{tor-hidden-service} procedure described below.
  9864. @item @code{socks-socket-type} (default: @code{'tcp})
  9865. The default socket type that Tor should use for its SOCKS socket. This must
  9866. be either @code{'tcp} or @code{'unix}. If it is @code{'tcp}, then by
  9867. default Tor will listen on TCP port 9050 on the loopback interface (i.e.,
  9868. localhost). If it is @code{'unix}, then Tor will listen on the UNIX domain
  9869. socket @file{/var/run/tor/socks-sock}, which will be made writable by
  9870. members of the @code{tor} group.
  9871. If you want to customize the SOCKS socket in more detail, leave
  9872. @code{socks-socket-type} at its default value of @code{'tcp} and use
  9873. @code{config-file} to override the default by providing your own
  9874. @code{SocksPort} option.
  9875. @end table
  9876. @end deftp
  9877. @cindex hidden service
  9878. @deffn {Scheme Procedure} tor-hidden-service @var{name} @var{mapping}
  9879. Define a new Tor @dfn{hidden service} called @var{name} and implementing
  9880. @var{mapping}. @var{mapping} is a list of port/host tuples, such as:
  9881. @example
  9882. '((22 "127.0.0.1:22")
  9883. (80 "127.0.0.1:8080"))
  9884. @end example
  9885. In this example, port 22 of the hidden service is mapped to local port 22,
  9886. and port 80 is mapped to local port 8080.
  9887. This creates a @file{/var/lib/tor/hidden-services/@var{name}} directory,
  9888. where the @file{hostname} file contains the @code{.onion} host name for the
  9889. hidden service.
  9890. See @uref{https://www.torproject.org/docs/tor-hidden-service.html.en, the
  9891. Tor project's documentation} for more information.
  9892. @end deffn
  9893. The @code{(gnu services rsync)} module provides the following services:
  9894. You might want an rsync daemon if you have files that you want available so
  9895. anyone (or just yourself) can download existing files or upload new files.
  9896. @deffn {Scheme Variable} rsync-service-type
  9897. This is the type for the @uref{https://rsync.samba.org, rsync} rsync daemon,
  9898. @command{rsync-configuration} record as in this example:
  9899. @example
  9900. (service rsync-service-type)
  9901. @end example
  9902. See below for details about @code{rsync-configuration}.
  9903. @end deffn
  9904. @deftp {Data Type} rsync-configuration
  9905. Data type representing the configuration for @code{rsync-service}.
  9906. @table @asis
  9907. @item @code{package} (default: @var{rsync})
  9908. @code{rsync} package to use.
  9909. @item @code{port-number} (default: @code{873})
  9910. TCP port on which @command{rsync} listens for incoming connections. If port
  9911. is less than @code{1024} @command{rsync} needs to be started as the
  9912. @code{root} user and group.
  9913. @item @code{pid-file} (default: @code{"/var/run/rsyncd/rsyncd.pid"})
  9914. Name of the file where @command{rsync} writes its PID.
  9915. @item @code{lock-file} (default: @code{"/var/run/rsyncd/rsyncd.lock"})
  9916. Name of the file where @command{rsync} writes its lock file.
  9917. @item @code{log-file} (default: @code{"/var/log/rsyncd.log"})
  9918. Name of the file where @command{rsync} writes its log file.
  9919. @item @code{use-chroot?} (default: @var{#t})
  9920. Whether to use chroot for @command{rsync} shared directory.
  9921. @item @code{share-path} (default: @file{/srv/rsync})
  9922. Location of the @command{rsync} shared directory.
  9923. @item @code{share-comment} (default: @code{"Rsync share"})
  9924. Comment of the @command{rsync} shared directory.
  9925. @item @code{read-only?} (default: @var{#f})
  9926. Read-write permissions to shared directory.
  9927. @item @code{timeout} (default: @code{300})
  9928. I/O timeout in seconds.
  9929. @item @code{user} (default: @var{"root"})
  9930. Owner of the @code{rsync} process.
  9931. @item @code{group} (default: @var{"root"})
  9932. Group of the @code{rsync} process.
  9933. @item @code{uid} (default: @var{"rsyncd"})
  9934. User name or user ID that file transfers to and from that module should take
  9935. place as when the daemon was run as @code{root}.
  9936. @item @code{gid} (default: @var{"rsyncd"})
  9937. Group name or group ID that will be used when accessing the module.
  9938. @end table
  9939. @end deftp
  9940. Furthermore, @code{(gnu services ssh)} provides the following services.
  9941. @cindex SSH
  9942. @cindex SSH server
  9943. @deffn {Scheme Procedure} lsh-service [#:host-key "/etc/lsh/host-key"] @
  9944. [#:daemonic? #t] [#:interfaces '()] [#:port-number 22] @
  9945. [#:allow-empty-passwords? #f] [#:root-login? #f] @ [#:syslog-output? #t]
  9946. [#:x11-forwarding? #t] @ [#:tcp/ip-forwarding? #t]
  9947. [#:password-authentication? #t] @ [#:public-key-authentication? #t]
  9948. [#:initialize? #t] Run the @command{lshd} program from @var{lsh} to listen
  9949. on port @var{port-number}. @var{host-key} must designate a file containing
  9950. the host key, and readable only by root.
  9951. When @var{daemonic?} is true, @command{lshd} will detach from the
  9952. controlling terminal and log its output to syslogd, unless one sets
  9953. @var{syslog-output?} to false. Obviously, it also makes lsh-service depend
  9954. on existence of syslogd service. When @var{pid-file?} is true,
  9955. @command{lshd} writes its PID to the file called @var{pid-file}.
  9956. When @var{initialize?} is true, automatically create the seed and host key
  9957. upon service activation if they do not exist yet. This may take long and
  9958. require interaction.
  9959. When @var{initialize?} is false, it is up to the user to initialize the
  9960. randomness generator (@pxref{lsh-make-seed,,, lsh, LSH Manual}), and to
  9961. create a key pair with the private key stored in file @var{host-key}
  9962. (@pxref{lshd basics,,, lsh, LSH Manual}).
  9963. When @var{interfaces} is empty, lshd listens for connections on all the
  9964. network interfaces; otherwise, @var{interfaces} must be a list of host names
  9965. or addresses.
  9966. @var{allow-empty-passwords?} specifies whether to accept log-ins with empty
  9967. passwords, and @var{root-login?} specifies whether to accept log-ins as
  9968. root.
  9969. The other options should be self-descriptive.
  9970. @end deffn
  9971. @cindex SSH
  9972. @cindex SSH server
  9973. @deffn {Scheme Variable} openssh-service-type
  9974. This is the type for the @uref{http://www.openssh.org, OpenSSH} secure shell
  9975. daemon, @command{sshd}. Its value must be an @code{openssh-configuration}
  9976. record as in this example:
  9977. @example
  9978. (service openssh-service-type
  9979. (openssh-configuration
  9980. (x11-forwarding? #t)
  9981. (permit-root-login 'without-password)
  9982. (authorized-keys
  9983. `(("alice" ,(local-file "alice.pub"))
  9984. ("bob" ,(local-file "bob.pub"))))))
  9985. @end example
  9986. See below for details about @code{openssh-configuration}.
  9987. This service can be extended with extra authorized keys, as in this example:
  9988. @example
  9989. (service-extension openssh-service-type
  9990. (const `(("charlie"
  9991. ,(local-file "charlie.pub")))))
  9992. @end example
  9993. @end deffn
  9994. @deftp {Data Type} openssh-configuration
  9995. This is the configuration record for OpenSSH's @command{sshd}.
  9996. @table @asis
  9997. @item @code{pid-file} (default: @code{"/var/run/sshd.pid"})
  9998. Name of the file where @command{sshd} writes its PID.
  9999. @item @code{port-number} (default: @code{22})
  10000. TCP port on which @command{sshd} listens for incoming connections.
  10001. @item @code{permit-root-login} (default: @code{#f})
  10002. This field determines whether and when to allow logins as root. If
  10003. @code{#f}, root logins are disallowed; if @code{#t}, they are allowed. If
  10004. it's the symbol @code{'without-password}, then root logins are permitted but
  10005. not with password-based authentication.
  10006. @item @code{allow-empty-passwords?} (default: @code{#f})
  10007. When true, users with empty passwords may log in. When false, they may not.
  10008. @item @code{password-authentication?} (default: @code{#t})
  10009. When true, users may log in with their password. When false, they have
  10010. other authentication methods.
  10011. @item @code{public-key-authentication?} (default: @code{#t})
  10012. When true, users may log in using public key authentication. When false,
  10013. users have to use other authentication method.
  10014. Authorized public keys are stored in @file{~/.ssh/authorized_keys}. This is
  10015. used only by protocol version 2.
  10016. @item @code{x11-forwarding?} (default: @code{#f})
  10017. When true, forwarding of X11 graphical client connections is enabled---in
  10018. other words, @command{ssh} options @option{-X} and @option{-Y} will work.
  10019. @item @code{allow-agent-forwarding?} (default: @code{#t})
  10020. Whether to allow agent forwarding.
  10021. @item @code{allow-tcp-forwarding?} (default: @code{#t})
  10022. Whether to allow TCP forwarding.
  10023. @item @code{gateway-ports?} (default: @code{#f})
  10024. Whether to allow gateway ports.
  10025. @item @code{challenge-response-authentication?} (default: @code{#f})
  10026. Specifies whether challenge response authentication is allowed (e.g.@: via
  10027. PAM).
  10028. @item @code{use-pam?} (default: @code{#t})
  10029. Enables the Pluggable Authentication Module interface. If set to @code{#t},
  10030. this will enable PAM authentication using
  10031. @code{challenge-response-authentication?} and
  10032. @code{password-authentication?}, in addition to PAM account and session
  10033. module processing for all authentication types.
  10034. Because PAM challenge response authentication usually serves an equivalent
  10035. role to password authentication, you should disable either
  10036. @code{challenge-response-authentication?} or
  10037. @code{password-authentication?}.
  10038. @item @code{print-last-log?} (default: @code{#t})
  10039. Specifies whether @command{sshd} should print the date and time of the last
  10040. user login when a user logs in interactively.
  10041. @item @code{subsystems} (default: @code{'(("sftp" "internal-sftp"))})
  10042. Configures external subsystems (e.g.@: file transfer daemon).
  10043. This is a list of two-element lists, each of which containing the subsystem
  10044. name and a command (with optional arguments) to execute upon subsystem
  10045. request.
  10046. The command @command{internal-sftp} implements an in-process SFTP server.
  10047. Alternately, one can specify the @command{sftp-server} command:
  10048. @example
  10049. (service openssh-service-type
  10050. (openssh-configuration
  10051. (subsystems
  10052. `(("sftp" ,(file-append openssh "/libexec/sftp-server"))))))
  10053. @end example
  10054. @item @code{accepted-environment} (default: @code{'()})
  10055. List of strings describing which environment variables may be exported.
  10056. Each string gets on its own line. See the @code{AcceptEnv} option in
  10057. @code{man sshd_config}.
  10058. This example allows ssh-clients to export the @code{COLORTERM} variable. It
  10059. is set by terminal emulators, which support colors. You can use it in your
  10060. shell's ressource file to enable colors for the prompt and commands if this
  10061. variable is set.
  10062. @example
  10063. (service openssh-service-type
  10064. (openssh-configuration
  10065. (accepted-environment '("COLORTERM"))))
  10066. @end example
  10067. @item @code{authorized-keys} (default: @code{'()})
  10068. @cindex authorized keys, SSH
  10069. @cindex SSH authorized keys
  10070. This is the list of authorized keys. Each element of the list is a user
  10071. name followed by one or more file-like objects that represent SSH public
  10072. keys. For example:
  10073. @example
  10074. (openssh-configuration
  10075. (authorized-keys
  10076. `(("rekado" ,(local-file "rekado.pub"))
  10077. ("chris" ,(local-file "chris.pub"))
  10078. ("root" ,(local-file "rekado.pub") ,(local-file "chris.pub")))))
  10079. @end example
  10080. @noindent
  10081. registers the specified public keys for user accounts @code{rekado},
  10082. @code{chris}, and @code{root}.
  10083. Additional authorized keys can be specified @i{via}
  10084. @code{service-extension}.
  10085. Note that this does @emph{not} interfere with the use of
  10086. @file{~/.ssh/authorized_keys}.
  10087. @item @code{log-level} (default: @code{'info})
  10088. This is a symbol specifying the logging level: @code{quiet}, @code{fatal},
  10089. @code{error}, @code{info}, @code{verbose}, @code{debug}, etc. See the man
  10090. page for @file{sshd_config} for the full list of level names.
  10091. @end table
  10092. @end deftp
  10093. @deffn {Scheme Procedure} dropbear-service [@var{config}]
  10094. Run the @uref{https://matt.ucc.asn.au/dropbear/dropbear.html,Dropbear SSH
  10095. daemon} with the given @var{config}, a @code{<dropbear-configuration>}
  10096. object.
  10097. For example, to specify a Dropbear service listening on port 1234, add this
  10098. call to the operating system's @code{services} field:
  10099. @example
  10100. (dropbear-service (dropbear-configuration
  10101. (port-number 1234)))
  10102. @end example
  10103. @end deffn
  10104. @deftp {Data Type} dropbear-configuration
  10105. This data type represents the configuration of a Dropbear SSH daemon.
  10106. @table @asis
  10107. @item @code{dropbear} (default: @var{dropbear})
  10108. The Dropbear package to use.
  10109. @item @code{port-number} (default: 22)
  10110. The TCP port where the daemon waits for incoming connections.
  10111. @item @code{syslog-output?} (default: @code{#t})
  10112. Whether to enable syslog output.
  10113. @item @code{pid-file} (default: @code{"/var/run/dropbear.pid"})
  10114. File name of the daemon's PID file.
  10115. @item @code{root-login?} (default: @code{#f})
  10116. Whether to allow @code{root} logins.
  10117. @item @code{allow-empty-passwords?} (default: @code{#f})
  10118. Whether to allow empty passwords.
  10119. @item @code{password-authentication?} (default: @code{#t})
  10120. Whether to enable password-based authentication.
  10121. @end table
  10122. @end deftp
  10123. @defvr {Scheme Variable} %facebook-host-aliases
  10124. This variable contains a string for use in @file{/etc/hosts} (@pxref{Host
  10125. Names,,, libc, The GNU C Library Reference Manual}). Each line contains a
  10126. entry that maps a known server name of the Facebook on-line service---e.g.,
  10127. @code{www.facebook.com}---to the local host---@code{127.0.0.1} or its IPv6
  10128. equivalent, @code{::1}.
  10129. This variable is typically used in the @code{hosts-file} field of an
  10130. @code{operating-system} declaration (@pxref{„operating-system“-Referenz,
  10131. @file{/etc/hosts}}):
  10132. @example
  10133. (use-modules (gnu) (guix))
  10134. (operating-system
  10135. (host-name "mymachine")
  10136. ;; ...
  10137. (hosts-file
  10138. ;; Create a /etc/hosts file with aliases for "localhost"
  10139. ;; and "mymachine", as well as for Facebook servers.
  10140. (plain-file "hosts"
  10141. (string-append (local-host-aliases host-name)
  10142. %facebook-host-aliases))))
  10143. @end example
  10144. This mechanism can prevent programs running locally, such as Web browsers,
  10145. from accessing Facebook.
  10146. @end defvr
  10147. The @code{(gnu services avahi)} provides the following definition.
  10148. @deffn {Scheme Procedure} avahi-service [#:avahi @var{avahi}] @
  10149. [#:host-name #f] [#:publish? #t] [#:ipv4? #t] @ [#:ipv6? #t] [#:wide-area?
  10150. #f] @ [#:domains-to-browse '()] [#:debug? #f] Return a service that runs
  10151. @command{avahi-daemon}, a system-wide mDNS/DNS-SD responder that allows for
  10152. service discovery and "zero-configuration" host name lookups (see
  10153. @uref{http://avahi.org/}), and extends the name service cache daemon (nscd)
  10154. so that it can resolve @code{.local} host names using
  10155. @uref{http://0pointer.de/lennart/projects/nss-mdns/, nss-mdns}.
  10156. Additionally, add the @var{avahi} package to the system profile so that
  10157. commands such as @command{avahi-browse} are directly usable.
  10158. If @var{host-name} is different from @code{#f}, use that as the host name to
  10159. publish for this machine; otherwise, use the machine's actual host name.
  10160. When @var{publish?} is true, publishing of host names and services is
  10161. allowed; in particular, avahi-daemon will publish the machine's host name
  10162. and IP address via mDNS on the local network.
  10163. When @var{wide-area?} is true, DNS-SD over unicast DNS is enabled.
  10164. Boolean values @var{ipv4?} and @var{ipv6?} determine whether to use
  10165. IPv4/IPv6 sockets.
  10166. @end deffn
  10167. @deffn {Scheme Variable} openvswitch-service-type
  10168. This is the type of the @uref{http://www.openvswitch.org, Open vSwitch}
  10169. service, whose value should be an @code{openvswitch-configuration} object.
  10170. @end deffn
  10171. @deftp {Data Type} openvswitch-configuration
  10172. Data type representing the configuration of Open vSwitch, a multilayer
  10173. virtual switch which is designed to enable massive network automation
  10174. through programmatic extension.
  10175. @table @asis
  10176. @item @code{package} (default: @var{openvswitch})
  10177. Package object of the Open vSwitch.
  10178. @end table
  10179. @end deftp
  10180. @node X Window
  10181. @subsubsection X Window
  10182. @cindex X11
  10183. @cindex X Window System
  10184. @cindex login manager
  10185. Support for the X Window graphical display system---specifically Xorg---is
  10186. provided by the @code{(gnu services xorg)} module. Note that there is no
  10187. @code{xorg-service} procedure. Instead, the X server is started by the
  10188. @dfn{login manager}, by default SLiM.
  10189. @cindex window manager
  10190. To use X11, you must install at least one @dfn{window manager}---for example
  10191. the @code{windowmaker} or @code{openbox} packages---preferably by adding it
  10192. to the @code{packages} field of your operating system definition
  10193. (@pxref{„operating-system“-Referenz, system-wide packages}).
  10194. @defvr {Scheme Variable} slim-service-type
  10195. This is the type for the SLiM graphical login manager for X11.
  10196. @cindex session types (X11)
  10197. @cindex X11 session types
  10198. SLiM looks for @dfn{session types} described by the @file{.desktop} files in
  10199. @file{/run/current-system/profile/share/xsessions} and allows users to
  10200. choose a session from the log-in screen using @kbd{F1}. Packages such as
  10201. @code{xfce}, @code{sawfish}, and @code{ratpoison} provide @file{.desktop}
  10202. files; adding them to the system-wide set of packages automatically makes
  10203. them available at the log-in screen.
  10204. In addition, @file{~/.xsession} files are honored. When available,
  10205. @file{~/.xsession} must be an executable that starts a window manager and/or
  10206. other X clients.
  10207. @end defvr
  10208. @deftp {Data Type} slim-configuration
  10209. Data type representing the configuration of @code{slim-service-type}.
  10210. @table @asis
  10211. @item @code{allow-empty-passwords?} (default: @code{#t})
  10212. Whether to allow logins with empty passwords.
  10213. @item @code{auto-login?} (default: @code{#f})
  10214. @itemx @code{default-user} (default: @code{""})
  10215. When @code{auto-login?} is false, SLiM presents a log-in screen.
  10216. When @code{auto-login?} is true, SLiM logs in directly as
  10217. @code{default-user}.
  10218. @item @code{theme} (default: @code{%default-slim-theme})
  10219. @itemx @code{theme-name} (default: @code{%default-slim-theme-name})
  10220. The graphical theme to use and its name.
  10221. @item @code{auto-login-session} (default: @code{#f})
  10222. If true, this must be the name of the executable to start as the default
  10223. session---e.g., @code{(file-append windowmaker "/bin/windowmaker")}.
  10224. If false, a session described by one of the available @file{.desktop} files
  10225. in @code{/run/current-system/profile} and @code{~/.guix-profile} will be
  10226. used.
  10227. @quotation Anmerkung
  10228. You must install at least one window manager in the system profile or in
  10229. your user profile. Failing to do that, if @code{auto-login-session} is
  10230. false, you will be unable to log in.
  10231. @end quotation
  10232. @item @code{startx} (default: @code{(xorg-start-command)})
  10233. The command used to start the X11 graphical server.
  10234. @item @code{xauth} (default: @code{xauth})
  10235. The XAuth package to use.
  10236. @item @code{shepherd} (default: @code{shepherd})
  10237. The Shepherd package used when invoking @command{halt} and @command{reboot}.
  10238. @item @code{sessreg} (default: @code{sessreg})
  10239. The sessreg package used in order to register the session.
  10240. @item @code{slim} (default: @code{slim})
  10241. The SLiM package to use.
  10242. @end table
  10243. @end deftp
  10244. @defvr {Scheme Variable} %default-theme
  10245. @defvrx {Scheme Variable} %default-theme-name
  10246. The default SLiM theme and its name.
  10247. @end defvr
  10248. @deftp {Data Type} sddm-configuration
  10249. This is the data type representing the sddm service configuration.
  10250. @table @asis
  10251. @item @code{display-server} (default: "x11")
  10252. Select display server to use for the greeter. Valid values are "x11" or
  10253. "wayland".
  10254. @item @code{numlock} (default: "on")
  10255. Valid values are "on", "off" or "none".
  10256. @item @code{halt-command} (default @code{#~(string-apppend #$shepherd "/sbin/halt")})
  10257. Command to run when halting.
  10258. @item @code{reboot-command} (default @code{#~(string-append #$shepherd "/sbin/reboot")})
  10259. Command to run when rebooting.
  10260. @item @code{theme} (default "maldives")
  10261. Theme to use. Default themes provided by SDDM are "elarun" or "maldives".
  10262. @item @code{themes-directory} (default "/run/current-system/profile/share/sddm/themes")
  10263. Directory to look for themes.
  10264. @item @code{faces-directory} (default "/run/current-system/profile/share/sddm/faces")
  10265. Directory to look for faces.
  10266. @item @code{default-path} (default "/run/current-system/profile/bin")
  10267. Default PATH to use.
  10268. @item @code{minimum-uid} (default 1000)
  10269. Minimum UID to display in SDDM.
  10270. @item @code{maximum-uid} (default 2000)
  10271. Maximum UID to display in SDDM
  10272. @item @code{remember-last-user?} (default #t)
  10273. Remember last user.
  10274. @item @code{remember-last-session?} (default #t)
  10275. Remember last session.
  10276. @item @code{hide-users} (default "")
  10277. Usernames to hide from SDDM greeter.
  10278. @item @code{hide-shells} (default @code{#~(string-append #$shadow "/sbin/nologin")})
  10279. Users with shells listed will be hidden from the SDDM greeter.
  10280. @item @code{session-command} (default @code{#~(string-append #$sddm "/share/sddm/scripts/wayland-session")})
  10281. Script to run before starting a wayland session.
  10282. @item @code{sessions-directory} (default "/run/current-system/profile/share/wayland-sessions")
  10283. Directory to look for desktop files starting wayland sessions.
  10284. @item @code{xorg-server-path} (default @code{xorg-start-command})
  10285. Path to xorg-server.
  10286. @item @code{xauth-path} (default @code{#~(string-append #$xauth "/bin/xauth")})
  10287. Path to xauth.
  10288. @item @code{xephyr-path} (default @code{#~(string-append #$xorg-server "/bin/Xephyr")})
  10289. Path to Xephyr.
  10290. @item @code{xdisplay-start} (default @code{#~(string-append #$sddm "/share/sddm/scripts/Xsetup")})
  10291. Script to run after starting xorg-server.
  10292. @item @code{xdisplay-stop} (default @code{#~(string-append #$sddm "/share/sddm/scripts/Xstop")})
  10293. Script to run before stopping xorg-server.
  10294. @item @code{xsession-command} (default: @code{xinitrc})
  10295. Script to run before starting a X session.
  10296. @item @code{xsessions-directory} (default: "/run/current-system/profile/share/xsessions")
  10297. Directory to look for desktop files starting X sessions.
  10298. @item @code{minimum-vt} (default: 7)
  10299. Minimum VT to use.
  10300. @item @code{xserver-arguments} (default "-nolisten tcp")
  10301. Arguments to pass to xorg-server.
  10302. @item @code{auto-login-user} (default "")
  10303. User to use for auto-login.
  10304. @item @code{auto-login-session} (default "")
  10305. Desktop file to use for auto-login.
  10306. @item @code{relogin?} (default #f)
  10307. Relogin after logout.
  10308. @end table
  10309. @end deftp
  10310. @cindex login manager
  10311. @cindex X11 login
  10312. @deffn {Scheme Procedure} sddm-service config
  10313. Return a service that spawns the SDDM graphical login manager for config of
  10314. type @code{<sddm-configuration>}.
  10315. @example
  10316. (sddm-service (sddm-configuration
  10317. (auto-login-user "Alice")
  10318. (auto-login-session "xfce.desktop")))
  10319. @end example
  10320. @end deffn
  10321. @deffn {Scheme Procedure} xorg-start-command [#:guile] @
  10322. [#:modules %default-xorg-modules] @ [#:fonts %default-xorg-fonts] @
  10323. [#:configuration-file (xorg-configuration-file @dots{})] @ [#:xorg-server
  10324. @var{xorg-server}] Return a @code{startx} script in which @var{modules}, a
  10325. list of X module packages, and @var{fonts}, a list of X font directories,
  10326. are available. See @code{xorg-wrapper} for more details on the arguments.
  10327. The result should be used in place of @code{startx}.
  10328. Usually the X server is started by a login manager.
  10329. @end deffn
  10330. @deffn {Scheme Procedure} xorg-configuration-file @
  10331. [#:modules %default-xorg-modules] @ [#:fonts %default-xorg-fonts] @
  10332. [#:drivers '()] [#:resolutions '()] [#:extra-config '()] Return a
  10333. configuration file for the Xorg server containing search paths for all the
  10334. common drivers.
  10335. @var{modules} must be a list of @dfn{module packages} loaded by the Xorg
  10336. server---e.g., @code{xf86-video-vesa}, @code{xf86-input-keyboard}, and so
  10337. on. @var{fonts} must be a list of font directories to add to the server's
  10338. @dfn{font path}.
  10339. @var{drivers} must be either the empty list, in which case Xorg chooses a
  10340. graphics driver automatically, or a list of driver names that will be tried
  10341. in this order---e.g., @code{("modesetting" "vesa")}.
  10342. Likewise, when @var{resolutions} is the empty list, Xorg chooses an
  10343. appropriate screen resolution; otherwise, it must be a list of
  10344. resolutions---e.g., @code{((1024 768) (640 480))}.
  10345. Last, @var{extra-config} is a list of strings or objects appended to the
  10346. configuration file. It is used to pass extra text to be added verbatim to
  10347. the configuration file.
  10348. @cindex keymap
  10349. @cindex keyboard layout
  10350. This procedure is especially useful to configure a different keyboard layout
  10351. than the default US keymap. For instance, to use the ``bépo'' keymap by
  10352. default on the display manager:
  10353. @example
  10354. (define bepo-evdev
  10355. "Section \"InputClass\"
  10356. Identifier \"evdev keyboard catchall\"
  10357. Driver \"evdev\"
  10358. MatchIsKeyboard \"on\"
  10359. Option \"xkb_layout\" \"fr\"
  10360. Option \"xkb_variant\" \"bepo\"
  10361. EndSection")
  10362. (operating-system
  10363. ...
  10364. (services
  10365. (modify-services %desktop-services
  10366. (slim-service-type config =>
  10367. (slim-configuration
  10368. (inherit config)
  10369. (startx (xorg-start-command
  10370. #:configuration-file
  10371. (xorg-configuration-file
  10372. #:extra-config
  10373. (list bepo-evdev)))))))))
  10374. @end example
  10375. The @code{MatchIsKeyboard} line specifies that we only apply the
  10376. configuration to keyboards. Without this line, other devices such as
  10377. touchpad may not work correctly because they will be attached to the wrong
  10378. driver. In this example, the user typically used @code{setxkbmap fr bepo}
  10379. to set their favorite keymap once logged in. The first argument corresponds
  10380. to the layout, while the second argument corresponds to the variant. The
  10381. @code{xkb_variant} line can be omitted to select the default variant.
  10382. @end deffn
  10383. @deffn {Scheme Procedure} screen-locker-service @var{package} [@var{program}]
  10384. Add @var{package}, a package for a screen locker or screen saver whose
  10385. command is @var{program}, to the set of setuid programs and add a PAM entry
  10386. for it. For example:
  10387. @lisp
  10388. (screen-locker-service xlockmore "xlock")
  10389. @end lisp
  10390. makes the good ol' XlockMore usable.
  10391. @end deffn
  10392. @node Druckdienste
  10393. @subsubsection Druckdienste
  10394. @cindex printer support with CUPS
  10395. The @code{(gnu services cups)} module provides a Guix service definition for
  10396. the CUPS printing service. To add printer support to a GuixSD system, add a
  10397. @code{cups-service} to the operating system definition:
  10398. @deffn {Scheme Variable} cups-service-type
  10399. The service type for the CUPS print server. Its value should be a valid
  10400. CUPS configuration (see below). To use the default settings, simply write:
  10401. @example
  10402. (service cups-service-type)
  10403. @end example
  10404. @end deffn
  10405. The CUPS configuration controls the basic things about your CUPS
  10406. installation: what interfaces it listens on, what to do if a print job
  10407. fails, how much logging to do, and so on. To actually add a printer, you
  10408. have to visit the @url{http://localhost:631} URL, or use a tool such as
  10409. GNOME's printer configuration services. By default, configuring a CUPS
  10410. service will generate a self-signed certificate if needed, for secure
  10411. connections to the print server.
  10412. Suppose you want to enable the Web interface of CUPS and also add support
  10413. for Epson printers @i{via} the @code{escpr} package and for HP printers
  10414. @i{via} the @code{hplip-minimal} package. You can do that directly, like
  10415. this (you need to use the @code{(gnu packages cups)} module):
  10416. @example
  10417. (service cups-service-type
  10418. (cups-configuration
  10419. (web-interface? #t)
  10420. (extensions
  10421. (list cups-filters escpr hplip-minimal))))
  10422. @end example
  10423. Note: If you wish to use the Qt5 based GUI which comes with the hplip
  10424. package then it is suggested that you install the @code{hplip} package,
  10425. either in your OS configuration file or as your user.
  10426. The available configuration parameters follow. Each parameter definition is
  10427. preceded by its type; for example, @samp{string-list foo} indicates that the
  10428. @code{foo} parameter should be specified as a list of strings. There is
  10429. also a way to specify the configuration as a string, if you have an old
  10430. @code{cupsd.conf} file that you want to port over from some other system;
  10431. see the end for more details.
  10432. @c The following documentation was initially generated by
  10433. @c (generate-documentation) in (gnu services cups). Manually maintained
  10434. @c documentation is better, so we shouldn't hesitate to edit below as
  10435. @c needed. However if the change you want to make to this documentation
  10436. @c can be done in an automated way, it's probably easier to change
  10437. @c (generate-documentation) than to make it below and have to deal with
  10438. @c the churn as CUPS updates.
  10439. Available @code{cups-configuration} fields are:
  10440. @deftypevr {@code{cups-configuration} parameter} package cups
  10441. The CUPS package.
  10442. @end deftypevr
  10443. @deftypevr {@code{cups-configuration} parameter} package-list extensions
  10444. Drivers and other extensions to the CUPS package.
  10445. @end deftypevr
  10446. @deftypevr {@code{cups-configuration} parameter} files-configuration files-configuration
  10447. Configuration of where to write logs, what directories to use for print
  10448. spools, and related privileged configuration parameters.
  10449. Available @code{files-configuration} fields are:
  10450. @deftypevr {@code{files-configuration} parameter} log-location access-log
  10451. Defines the access log filename. Specifying a blank filename disables
  10452. access log generation. The value @code{stderr} causes log entries to be
  10453. sent to the standard error file when the scheduler is running in the
  10454. foreground, or to the system log daemon when run in the background. The
  10455. value @code{syslog} causes log entries to be sent to the system log daemon.
  10456. The server name may be included in filenames using the string @code{%s}, as
  10457. in @code{/var/log/cups/%s-access_log}.
  10458. Defaults to @samp{"/var/log/cups/access_log"}.
  10459. @end deftypevr
  10460. @deftypevr {@code{files-configuration} parameter} file-name cache-dir
  10461. Where CUPS should cache data.
  10462. Defaults to @samp{"/var/cache/cups"}.
  10463. @end deftypevr
  10464. @deftypevr {@code{files-configuration} parameter} string config-file-perm
  10465. Specifies the permissions for all configuration files that the scheduler
  10466. writes.
  10467. Note that the permissions for the printers.conf file are currently masked to
  10468. only allow access from the scheduler user (typically root). This is done
  10469. because printer device URIs sometimes contain sensitive authentication
  10470. information that should not be generally known on the system. There is no
  10471. way to disable this security feature.
  10472. Defaults to @samp{"0640"}.
  10473. @end deftypevr
  10474. @deftypevr {@code{files-configuration} parameter} log-location error-log
  10475. Defines the error log filename. Specifying a blank filename disables access
  10476. log generation. The value @code{stderr} causes log entries to be sent to
  10477. the standard error file when the scheduler is running in the foreground, or
  10478. to the system log daemon when run in the background. The value
  10479. @code{syslog} causes log entries to be sent to the system log daemon. The
  10480. server name may be included in filenames using the string @code{%s}, as in
  10481. @code{/var/log/cups/%s-error_log}.
  10482. Defaults to @samp{"/var/log/cups/error_log"}.
  10483. @end deftypevr
  10484. @deftypevr {@code{files-configuration} parameter} string fatal-errors
  10485. Specifies which errors are fatal, causing the scheduler to exit. The kind
  10486. strings are:
  10487. @table @code
  10488. @item none
  10489. No errors are fatal.
  10490. @item all
  10491. All of the errors below are fatal.
  10492. @item browse
  10493. Browsing initialization errors are fatal, for example failed connections to
  10494. the DNS-SD daemon.
  10495. @item config
  10496. Configuration file syntax errors are fatal.
  10497. @item listen
  10498. Listen or Port errors are fatal, except for IPv6 failures on the loopback or
  10499. @code{any} addresses.
  10500. @item log
  10501. Log file creation or write errors are fatal.
  10502. @item permissions
  10503. Bad startup file permissions are fatal, for example shared TLS certificate
  10504. and key files with world-read permissions.
  10505. @end table
  10506. Defaults to @samp{"all -browse"}.
  10507. @end deftypevr
  10508. @deftypevr {@code{files-configuration} parameter} boolean file-device?
  10509. Specifies whether the file pseudo-device can be used for new printer
  10510. queues. The URI @uref{file:///dev/null} is always allowed.
  10511. Defaults to @samp{#f}.
  10512. @end deftypevr
  10513. @deftypevr {@code{files-configuration} parameter} string group
  10514. Specifies the group name or ID that will be used when executing external
  10515. programs.
  10516. Defaults to @samp{"lp"}.
  10517. @end deftypevr
  10518. @deftypevr {@code{files-configuration} parameter} string log-file-perm
  10519. Specifies the permissions for all log files that the scheduler writes.
  10520. Defaults to @samp{"0644"}.
  10521. @end deftypevr
  10522. @deftypevr {@code{files-configuration} parameter} log-location page-log
  10523. Defines the page log filename. Specifying a blank filename disables access
  10524. log generation. The value @code{stderr} causes log entries to be sent to
  10525. the standard error file when the scheduler is running in the foreground, or
  10526. to the system log daemon when run in the background. The value
  10527. @code{syslog} causes log entries to be sent to the system log daemon. The
  10528. server name may be included in filenames using the string @code{%s}, as in
  10529. @code{/var/log/cups/%s-page_log}.
  10530. Defaults to @samp{"/var/log/cups/page_log"}.
  10531. @end deftypevr
  10532. @deftypevr {@code{files-configuration} parameter} string remote-root
  10533. Specifies the username that is associated with unauthenticated accesses by
  10534. clients claiming to be the root user. The default is @code{remroot}.
  10535. Defaults to @samp{"remroot"}.
  10536. @end deftypevr
  10537. @deftypevr {@code{files-configuration} parameter} file-name request-root
  10538. Specifies the directory that contains print jobs and other HTTP request
  10539. data.
  10540. Defaults to @samp{"/var/spool/cups"}.
  10541. @end deftypevr
  10542. @deftypevr {@code{files-configuration} parameter} sandboxing sandboxing
  10543. Specifies the level of security sandboxing that is applied to print filters,
  10544. backends, and other child processes of the scheduler; either @code{relaxed}
  10545. or @code{strict}. This directive is currently only used/supported on macOS.
  10546. Defaults to @samp{strict}.
  10547. @end deftypevr
  10548. @deftypevr {@code{files-configuration} parameter} file-name server-keychain
  10549. Specifies the location of TLS certificates and private keys. CUPS will look
  10550. for public and private keys in this directory: a @code{.crt} files for
  10551. PEM-encoded certificates and corresponding @code{.key} files for PEM-encoded
  10552. private keys.
  10553. Defaults to @samp{"/etc/cups/ssl"}.
  10554. @end deftypevr
  10555. @deftypevr {@code{files-configuration} parameter} file-name server-root
  10556. Specifies the directory containing the server configuration files.
  10557. Defaults to @samp{"/etc/cups"}.
  10558. @end deftypevr
  10559. @deftypevr {@code{files-configuration} parameter} boolean sync-on-close?
  10560. Specifies whether the scheduler calls fsync(2) after writing configuration
  10561. or state files.
  10562. Defaults to @samp{#f}.
  10563. @end deftypevr
  10564. @deftypevr {@code{files-configuration} parameter} space-separated-string-list system-group
  10565. Specifies the group(s) to use for @code{@@SYSTEM} group authentication.
  10566. @end deftypevr
  10567. @deftypevr {@code{files-configuration} parameter} file-name temp-dir
  10568. Specifies the directory where temporary files are stored.
  10569. Defaults to @samp{"/var/spool/cups/tmp"}.
  10570. @end deftypevr
  10571. @deftypevr {@code{files-configuration} parameter} string user
  10572. Specifies the user name or ID that is used when running external programs.
  10573. Defaults to @samp{"lp"}.
  10574. @end deftypevr
  10575. @end deftypevr
  10576. @deftypevr {@code{cups-configuration} parameter} access-log-level access-log-level
  10577. Specifies the logging level for the AccessLog file. The @code{config} level
  10578. logs when printers and classes are added, deleted, or modified and when
  10579. configuration files are accessed or updated. The @code{actions} level logs
  10580. when print jobs are submitted, held, released, modified, or canceled, and
  10581. any of the conditions for @code{config}. The @code{all} level logs all
  10582. requests.
  10583. Defaults to @samp{actions}.
  10584. @end deftypevr
  10585. @deftypevr {@code{cups-configuration} parameter} boolean auto-purge-jobs?
  10586. Specifies whether to purge job history data automatically when it is no
  10587. longer required for quotas.
  10588. Defaults to @samp{#f}.
  10589. @end deftypevr
  10590. @deftypevr {@code{cups-configuration} parameter} browse-local-protocols browse-local-protocols
  10591. Specifies which protocols to use for local printer sharing.
  10592. Defaults to @samp{dnssd}.
  10593. @end deftypevr
  10594. @deftypevr {@code{cups-configuration} parameter} boolean browse-web-if?
  10595. Specifies whether the CUPS web interface is advertised.
  10596. Defaults to @samp{#f}.
  10597. @end deftypevr
  10598. @deftypevr {@code{cups-configuration} parameter} boolean browsing?
  10599. Specifies whether shared printers are advertised.
  10600. Defaults to @samp{#f}.
  10601. @end deftypevr
  10602. @deftypevr {@code{cups-configuration} parameter} string classification
  10603. Specifies the security classification of the server. Any valid banner name
  10604. can be used, including "classified", "confidential", "secret", "topsecret",
  10605. and "unclassified", or the banner can be omitted to disable secure printing
  10606. functions.
  10607. Defaults to @samp{""}.
  10608. @end deftypevr
  10609. @deftypevr {@code{cups-configuration} parameter} boolean classify-override?
  10610. Specifies whether users may override the classification (cover page) of
  10611. individual print jobs using the @code{job-sheets} option.
  10612. Defaults to @samp{#f}.
  10613. @end deftypevr
  10614. @deftypevr {@code{cups-configuration} parameter} default-auth-type default-auth-type
  10615. Specifies the default type of authentication to use.
  10616. Defaults to @samp{Basic}.
  10617. @end deftypevr
  10618. @deftypevr {@code{cups-configuration} parameter} default-encryption default-encryption
  10619. Specifies whether encryption will be used for authenticated requests.
  10620. Defaults to @samp{Required}.
  10621. @end deftypevr
  10622. @deftypevr {@code{cups-configuration} parameter} string default-language
  10623. Specifies the default language to use for text and web content.
  10624. Defaults to @samp{"en"}.
  10625. @end deftypevr
  10626. @deftypevr {@code{cups-configuration} parameter} string default-paper-size
  10627. Specifies the default paper size for new print queues. @samp{"Auto"} uses a
  10628. locale-specific default, while @samp{"None"} specifies there is no default
  10629. paper size. Specific size names are typically @samp{"Letter"} or
  10630. @samp{"A4"}.
  10631. Defaults to @samp{"Auto"}.
  10632. @end deftypevr
  10633. @deftypevr {@code{cups-configuration} parameter} string default-policy
  10634. Specifies the default access policy to use.
  10635. Defaults to @samp{"default"}.
  10636. @end deftypevr
  10637. @deftypevr {@code{cups-configuration} parameter} boolean default-shared?
  10638. Specifies whether local printers are shared by default.
  10639. Defaults to @samp{#t}.
  10640. @end deftypevr
  10641. @deftypevr {@code{cups-configuration} parameter} non-negative-integer dirty-clean-interval
  10642. Specifies the delay for updating of configuration and state files, in
  10643. seconds. A value of 0 causes the update to happen as soon as possible,
  10644. typically within a few milliseconds.
  10645. Defaults to @samp{30}.
  10646. @end deftypevr
  10647. @deftypevr {@code{cups-configuration} parameter} error-policy error-policy
  10648. Specifies what to do when an error occurs. Possible values are
  10649. @code{abort-job}, which will discard the failed print job; @code{retry-job},
  10650. which will retry the job at a later time; @code{retry-this-job}, which
  10651. retries the failed job immediately; and @code{stop-printer}, which stops the
  10652. printer.
  10653. Defaults to @samp{stop-printer}.
  10654. @end deftypevr
  10655. @deftypevr {@code{cups-configuration} parameter} non-negative-integer filter-limit
  10656. Specifies the maximum cost of filters that are run concurrently, which can
  10657. be used to minimize disk, memory, and CPU resource problems. A limit of 0
  10658. disables filter limiting. An average print to a non-PostScript printer
  10659. needs a filter limit of about 200. A PostScript printer needs about half
  10660. that (100). Setting the limit below these thresholds will effectively limit
  10661. the scheduler to printing a single job at any time.
  10662. Defaults to @samp{0}.
  10663. @end deftypevr
  10664. @deftypevr {@code{cups-configuration} parameter} non-negative-integer filter-nice
  10665. Specifies the scheduling priority of filters that are run to print a job.
  10666. The nice value ranges from 0, the highest priority, to 19, the lowest
  10667. priority.
  10668. Defaults to @samp{0}.
  10669. @end deftypevr
  10670. @deftypevr {@code{cups-configuration} parameter} host-name-lookups host-name-lookups
  10671. Specifies whether to do reverse lookups on connecting clients. The
  10672. @code{double} setting causes @code{cupsd} to verify that the hostname
  10673. resolved from the address matches one of the addresses returned for that
  10674. hostname. Double lookups also prevent clients with unregistered addresses
  10675. from connecting to your server. Only set this option to @code{#t} or
  10676. @code{double} if absolutely required.
  10677. Defaults to @samp{#f}.
  10678. @end deftypevr
  10679. @deftypevr {@code{cups-configuration} parameter} non-negative-integer job-kill-delay
  10680. Specifies the number of seconds to wait before killing the filters and
  10681. backend associated with a canceled or held job.
  10682. Defaults to @samp{30}.
  10683. @end deftypevr
  10684. @deftypevr {@code{cups-configuration} parameter} non-negative-integer job-retry-interval
  10685. Specifies the interval between retries of jobs in seconds. This is
  10686. typically used for fax queues but can also be used with normal print queues
  10687. whose error policy is @code{retry-job} or @code{retry-current-job}.
  10688. Defaults to @samp{30}.
  10689. @end deftypevr
  10690. @deftypevr {@code{cups-configuration} parameter} non-negative-integer job-retry-limit
  10691. Specifies the number of retries that are done for jobs. This is typically
  10692. used for fax queues but can also be used with normal print queues whose
  10693. error policy is @code{retry-job} or @code{retry-current-job}.
  10694. Defaults to @samp{5}.
  10695. @end deftypevr
  10696. @deftypevr {@code{cups-configuration} parameter} boolean keep-alive?
  10697. Specifies whether to support HTTP keep-alive connections.
  10698. Defaults to @samp{#t}.
  10699. @end deftypevr
  10700. @deftypevr {@code{cups-configuration} parameter} non-negative-integer keep-alive-timeout
  10701. Specifies how long an idle client connection remains open, in seconds.
  10702. Defaults to @samp{30}.
  10703. @end deftypevr
  10704. @deftypevr {@code{cups-configuration} parameter} non-negative-integer limit-request-body
  10705. Specifies the maximum size of print files, IPP requests, and HTML form
  10706. data. A limit of 0 disables the limit check.
  10707. Defaults to @samp{0}.
  10708. @end deftypevr
  10709. @deftypevr {@code{cups-configuration} parameter} multiline-string-list listen
  10710. Listens on the specified interfaces for connections. Valid values are of
  10711. the form @var{address}:@var{port}, where @var{address} is either an IPv6
  10712. address enclosed in brackets, an IPv4 address, or @code{*} to indicate all
  10713. addresses. Values can also be file names of local UNIX domain sockets. The
  10714. Listen directive is similar to the Port directive but allows you to restrict
  10715. access to specific interfaces or networks.
  10716. @end deftypevr
  10717. @deftypevr {@code{cups-configuration} parameter} non-negative-integer listen-back-log
  10718. Specifies the number of pending connections that will be allowed. This
  10719. normally only affects very busy servers that have reached the MaxClients
  10720. limit, but can also be triggered by large numbers of simultaneous
  10721. connections. When the limit is reached, the operating system will refuse
  10722. additional connections until the scheduler can accept the pending ones.
  10723. Defaults to @samp{128}.
  10724. @end deftypevr
  10725. @deftypevr {@code{cups-configuration} parameter} location-access-control-list location-access-controls
  10726. Specifies a set of additional access controls.
  10727. Available @code{location-access-controls} fields are:
  10728. @deftypevr {@code{location-access-controls} parameter} file-name path
  10729. Specifies the URI path to which the access control applies.
  10730. @end deftypevr
  10731. @deftypevr {@code{location-access-controls} parameter} access-control-list access-controls
  10732. Access controls for all access to this path, in the same format as the
  10733. @code{access-controls} of @code{operation-access-control}.
  10734. Defaults to @samp{()}.
  10735. @end deftypevr
  10736. @deftypevr {@code{location-access-controls} parameter} method-access-control-list method-access-controls
  10737. Access controls for method-specific access to this path.
  10738. Defaults to @samp{()}.
  10739. Available @code{method-access-controls} fields are:
  10740. @deftypevr {@code{method-access-controls} parameter} boolean reverse?
  10741. If @code{#t}, apply access controls to all methods except the listed
  10742. methods. Otherwise apply to only the listed methods.
  10743. Defaults to @samp{#f}.
  10744. @end deftypevr
  10745. @deftypevr {@code{method-access-controls} parameter} method-list methods
  10746. Methods to which this access control applies.
  10747. Defaults to @samp{()}.
  10748. @end deftypevr
  10749. @deftypevr {@code{method-access-controls} parameter} access-control-list access-controls
  10750. Access control directives, as a list of strings. Each string should be one
  10751. directive, such as "Order allow,deny".
  10752. Defaults to @samp{()}.
  10753. @end deftypevr
  10754. @end deftypevr
  10755. @end deftypevr
  10756. @deftypevr {@code{cups-configuration} parameter} non-negative-integer log-debug-history
  10757. Specifies the number of debugging messages that are retained for logging if
  10758. an error occurs in a print job. Debug messages are logged regardless of the
  10759. LogLevel setting.
  10760. Defaults to @samp{100}.
  10761. @end deftypevr
  10762. @deftypevr {@code{cups-configuration} parameter} log-level log-level
  10763. Specifies the level of logging for the ErrorLog file. The value @code{none}
  10764. stops all logging while @code{debug2} logs everything.
  10765. Defaults to @samp{info}.
  10766. @end deftypevr
  10767. @deftypevr {@code{cups-configuration} parameter} log-time-format log-time-format
  10768. Specifies the format of the date and time in the log files. The value
  10769. @code{standard} logs whole seconds while @code{usecs} logs microseconds.
  10770. Defaults to @samp{standard}.
  10771. @end deftypevr
  10772. @deftypevr {@code{cups-configuration} parameter} non-negative-integer max-clients
  10773. Specifies the maximum number of simultaneous clients that are allowed by the
  10774. scheduler.
  10775. Defaults to @samp{100}.
  10776. @end deftypevr
  10777. @deftypevr {@code{cups-configuration} parameter} non-negative-integer max-clients-per-host
  10778. Specifies the maximum number of simultaneous clients that are allowed from a
  10779. single address.
  10780. Defaults to @samp{100}.
  10781. @end deftypevr
  10782. @deftypevr {@code{cups-configuration} parameter} non-negative-integer max-copies
  10783. Specifies the maximum number of copies that a user can print of each job.
  10784. Defaults to @samp{9999}.
  10785. @end deftypevr
  10786. @deftypevr {@code{cups-configuration} parameter} non-negative-integer max-hold-time
  10787. Specifies the maximum time a job may remain in the @code{indefinite} hold
  10788. state before it is canceled. A value of 0 disables cancellation of held
  10789. jobs.
  10790. Defaults to @samp{0}.
  10791. @end deftypevr
  10792. @deftypevr {@code{cups-configuration} parameter} non-negative-integer max-jobs
  10793. Specifies the maximum number of simultaneous jobs that are allowed. Set to
  10794. 0 to allow an unlimited number of jobs.
  10795. Defaults to @samp{500}.
  10796. @end deftypevr
  10797. @deftypevr {@code{cups-configuration} parameter} non-negative-integer max-jobs-per-printer
  10798. Specifies the maximum number of simultaneous jobs that are allowed per
  10799. printer. A value of 0 allows up to MaxJobs jobs per printer.
  10800. Defaults to @samp{0}.
  10801. @end deftypevr
  10802. @deftypevr {@code{cups-configuration} parameter} non-negative-integer max-jobs-per-user
  10803. Specifies the maximum number of simultaneous jobs that are allowed per
  10804. user. A value of 0 allows up to MaxJobs jobs per user.
  10805. Defaults to @samp{0}.
  10806. @end deftypevr
  10807. @deftypevr {@code{cups-configuration} parameter} non-negative-integer max-job-time
  10808. Specifies the maximum time a job may take to print before it is canceled, in
  10809. seconds. Set to 0 to disable cancellation of "stuck" jobs.
  10810. Defaults to @samp{10800}.
  10811. @end deftypevr
  10812. @deftypevr {@code{cups-configuration} parameter} non-negative-integer max-log-size
  10813. Specifies the maximum size of the log files before they are rotated, in
  10814. bytes. The value 0 disables log rotation.
  10815. Defaults to @samp{1048576}.
  10816. @end deftypevr
  10817. @deftypevr {@code{cups-configuration} parameter} non-negative-integer multiple-operation-timeout
  10818. Specifies the maximum amount of time to allow between files in a multiple
  10819. file print job, in seconds.
  10820. Defaults to @samp{300}.
  10821. @end deftypevr
  10822. @deftypevr {@code{cups-configuration} parameter} string page-log-format
  10823. Specifies the format of PageLog lines. Sequences beginning with percent
  10824. (@samp{%}) characters are replaced with the corresponding information, while
  10825. all other characters are copied literally. The following percent sequences
  10826. are recognized:
  10827. @table @samp
  10828. @item %%
  10829. insert a single percent character
  10830. @item %@{name@}
  10831. insert the value of the specified IPP attribute
  10832. @item %C
  10833. insert the number of copies for the current page
  10834. @item %P
  10835. insert the current page number
  10836. @item %T
  10837. insert the current date and time in common log format
  10838. @item %j
  10839. insert the job ID
  10840. @item %p
  10841. insert the printer name
  10842. @item %u
  10843. insert the username
  10844. @end table
  10845. A value of the empty string disables page logging. The string @code{%p %u
  10846. %j %T %P %C %@{job-billing@} %@{job-originating-host-name@} %@{job-name@}
  10847. %@{media@} %@{sides@}} creates a page log with the standard items.
  10848. Defaults to @samp{""}.
  10849. @end deftypevr
  10850. @deftypevr {@code{cups-configuration} parameter} environment-variables environment-variables
  10851. Passes the specified environment variable(s) to child processes; a list of
  10852. strings.
  10853. Defaults to @samp{()}.
  10854. @end deftypevr
  10855. @deftypevr {@code{cups-configuration} parameter} policy-configuration-list policies
  10856. Specifies named access control policies.
  10857. Available @code{policy-configuration} fields are:
  10858. @deftypevr {@code{policy-configuration} parameter} string name
  10859. Name of the policy.
  10860. @end deftypevr
  10861. @deftypevr {@code{policy-configuration} parameter} string job-private-access
  10862. Specifies an access list for a job's private values. @code{@@ACL} maps to
  10863. the printer's requesting-user-name-allowed or requesting-user-name-denied
  10864. values. @code{@@OWNER} maps to the job's owner. @code{@@SYSTEM} maps to
  10865. the groups listed for the @code{system-group} field of the
  10866. @code{files-config} configuration, which is reified into the
  10867. @code{cups-files.conf(5)} file. Other possible elements of the access list
  10868. include specific user names, and @code{@@@var{group}} to indicate members of
  10869. a specific group. The access list may also be simply @code{all} or
  10870. @code{default}.
  10871. Defaults to @samp{"@@OWNER @@SYSTEM"}.
  10872. @end deftypevr
  10873. @deftypevr {@code{policy-configuration} parameter} string job-private-values
  10874. Specifies the list of job values to make private, or @code{all},
  10875. @code{default}, or @code{none}.
  10876. Defaults to @samp{"job-name job-originating-host-name
  10877. job-originating-user-name phone"}.
  10878. @end deftypevr
  10879. @deftypevr {@code{policy-configuration} parameter} string subscription-private-access
  10880. Specifies an access list for a subscription's private values. @code{@@ACL}
  10881. maps to the printer's requesting-user-name-allowed or
  10882. requesting-user-name-denied values. @code{@@OWNER} maps to the job's
  10883. owner. @code{@@SYSTEM} maps to the groups listed for the
  10884. @code{system-group} field of the @code{files-config} configuration, which is
  10885. reified into the @code{cups-files.conf(5)} file. Other possible elements of
  10886. the access list include specific user names, and @code{@@@var{group}} to
  10887. indicate members of a specific group. The access list may also be simply
  10888. @code{all} or @code{default}.
  10889. Defaults to @samp{"@@OWNER @@SYSTEM"}.
  10890. @end deftypevr
  10891. @deftypevr {@code{policy-configuration} parameter} string subscription-private-values
  10892. Specifies the list of job values to make private, or @code{all},
  10893. @code{default}, or @code{none}.
  10894. Defaults to @samp{"notify-events notify-pull-method notify-recipient-uri
  10895. notify-subscriber-user-name notify-user-data"}.
  10896. @end deftypevr
  10897. @deftypevr {@code{policy-configuration} parameter} operation-access-control-list access-controls
  10898. Access control by IPP operation.
  10899. Defaults to @samp{()}.
  10900. @end deftypevr
  10901. @end deftypevr
  10902. @deftypevr {@code{cups-configuration} parameter} boolean-or-non-negative-integer preserve-job-files
  10903. Specifies whether job files (documents) are preserved after a job is
  10904. printed. If a numeric value is specified, job files are preserved for the
  10905. indicated number of seconds after printing. Otherwise a boolean value
  10906. applies indefinitely.
  10907. Defaults to @samp{86400}.
  10908. @end deftypevr
  10909. @deftypevr {@code{cups-configuration} parameter} boolean-or-non-negative-integer preserve-job-history
  10910. Specifies whether the job history is preserved after a job is printed. If a
  10911. numeric value is specified, the job history is preserved for the indicated
  10912. number of seconds after printing. If @code{#t}, the job history is
  10913. preserved until the MaxJobs limit is reached.
  10914. Defaults to @samp{#t}.
  10915. @end deftypevr
  10916. @deftypevr {@code{cups-configuration} parameter} non-negative-integer reload-timeout
  10917. Specifies the amount of time to wait for job completion before restarting
  10918. the scheduler.
  10919. Defaults to @samp{30}.
  10920. @end deftypevr
  10921. @deftypevr {@code{cups-configuration} parameter} string rip-cache
  10922. Specifies the maximum amount of memory to use when converting documents into
  10923. bitmaps for a printer.
  10924. Defaults to @samp{"128m"}.
  10925. @end deftypevr
  10926. @deftypevr {@code{cups-configuration} parameter} string server-admin
  10927. Specifies the email address of the server administrator.
  10928. Defaults to @samp{"root@@localhost.localdomain"}.
  10929. @end deftypevr
  10930. @deftypevr {@code{cups-configuration} parameter} host-name-list-or-* server-alias
  10931. The ServerAlias directive is used for HTTP Host header validation when
  10932. clients connect to the scheduler from external interfaces. Using the
  10933. special name @code{*} can expose your system to known browser-based DNS
  10934. rebinding attacks, even when accessing sites through a firewall. If the
  10935. auto-discovery of alternate names does not work, we recommend listing each
  10936. alternate name with a ServerAlias directive instead of using @code{*}.
  10937. Defaults to @samp{*}.
  10938. @end deftypevr
  10939. @deftypevr {@code{cups-configuration} parameter} string server-name
  10940. Specifies the fully-qualified host name of the server.
  10941. Defaults to @samp{"localhost"}.
  10942. @end deftypevr
  10943. @deftypevr {@code{cups-configuration} parameter} server-tokens server-tokens
  10944. Specifies what information is included in the Server header of HTTP
  10945. responses. @code{None} disables the Server header. @code{ProductOnly}
  10946. reports @code{CUPS}. @code{Major} reports @code{CUPS 2}. @code{Minor}
  10947. reports @code{CUPS 2.0}. @code{Minimal} reports @code{CUPS 2.0.0}.
  10948. @code{OS} reports @code{CUPS 2.0.0 (@var{uname})} where @var{uname} is the
  10949. output of the @code{uname} command. @code{Full} reports @code{CUPS 2.0.0
  10950. (@var{uname}) IPP/2.0}.
  10951. Defaults to @samp{Minimal}.
  10952. @end deftypevr
  10953. @deftypevr {@code{cups-configuration} parameter} string set-env
  10954. Set the specified environment variable to be passed to child processes.
  10955. Defaults to @samp{"variable value"}.
  10956. @end deftypevr
  10957. @deftypevr {@code{cups-configuration} parameter} multiline-string-list ssl-listen
  10958. Listens on the specified interfaces for encrypted connections. Valid values
  10959. are of the form @var{address}:@var{port}, where @var{address} is either an
  10960. IPv6 address enclosed in brackets, an IPv4 address, or @code{*} to indicate
  10961. all addresses.
  10962. Defaults to @samp{()}.
  10963. @end deftypevr
  10964. @deftypevr {@code{cups-configuration} parameter} ssl-options ssl-options
  10965. Sets encryption options. By default, CUPS only supports encryption using
  10966. TLS v1.0 or higher using known secure cipher suites. The @code{AllowRC4}
  10967. option enables the 128-bit RC4 cipher suites, which are required for some
  10968. older clients that do not implement newer ones. The @code{AllowSSL3} option
  10969. enables SSL v3.0, which is required for some older clients that do not
  10970. support TLS v1.0.
  10971. Defaults to @samp{()}.
  10972. @end deftypevr
  10973. @deftypevr {@code{cups-configuration} parameter} boolean strict-conformance?
  10974. Specifies whether the scheduler requires clients to strictly adhere to the
  10975. IPP specifications.
  10976. Defaults to @samp{#f}.
  10977. @end deftypevr
  10978. @deftypevr {@code{cups-configuration} parameter} non-negative-integer timeout
  10979. Specifies the HTTP request timeout, in seconds.
  10980. Defaults to @samp{300}.
  10981. @end deftypevr
  10982. @deftypevr {@code{cups-configuration} parameter} boolean web-interface?
  10983. Specifies whether the web interface is enabled.
  10984. Defaults to @samp{#f}.
  10985. @end deftypevr
  10986. At this point you're probably thinking ``oh dear, Guix manual, I like you
  10987. but you can stop already with the configuration options''. Indeed.
  10988. However, one more point: it could be that you have an existing
  10989. @code{cupsd.conf} that you want to use. In that case, you can pass an
  10990. @code{opaque-cups-configuration} as the configuration of a
  10991. @code{cups-service-type}.
  10992. Available @code{opaque-cups-configuration} fields are:
  10993. @deftypevr {@code{opaque-cups-configuration} parameter} package cups
  10994. The CUPS package.
  10995. @end deftypevr
  10996. @deftypevr {@code{opaque-cups-configuration} parameter} string cupsd.conf
  10997. The contents of the @code{cupsd.conf}, as a string.
  10998. @end deftypevr
  10999. @deftypevr {@code{opaque-cups-configuration} parameter} string cups-files.conf
  11000. The contents of the @code{cups-files.conf} file, as a string.
  11001. @end deftypevr
  11002. For example, if your @code{cupsd.conf} and @code{cups-files.conf} are in
  11003. strings of the same name, you could instantiate a CUPS service like this:
  11004. @example
  11005. (service cups-service-type
  11006. (opaque-cups-configuration
  11007. (cupsd.conf cupsd.conf)
  11008. (cups-files.conf cups-files.conf)))
  11009. @end example
  11010. @node Desktop-Dienste
  11011. @subsubsection Desktop-Dienste
  11012. The @code{(gnu services desktop)} module provides services that are usually
  11013. useful in the context of a ``desktop'' setup---that is, on a machine running
  11014. a graphical display server, possibly with graphical user interfaces, etc.
  11015. It also defines services that provide specific desktop environments like
  11016. GNOME, XFCE or MATE.
  11017. To simplify things, the module defines a variable containing the set of
  11018. services that users typically expect on a machine with a graphical
  11019. environment and networking:
  11020. @defvr {Scheme Variable} %desktop-services
  11021. This is a list of services that builds upon @var{%base-services} and adds or
  11022. adjusts services for a typical ``desktop'' setup.
  11023. In particular, it adds a graphical login manager (@pxref{X Window,
  11024. @code{slim-service}}), screen lockers, a network management tool
  11025. (@pxref{Netzwerkdienste, @code{network-manager-service-type}}), energy
  11026. and color management services, the @code{elogind} login and seat manager,
  11027. the Polkit privilege service, the GeoClue location service, the
  11028. AccountsService daemon that allows authorized users change system passwords,
  11029. an NTP client (@pxref{Netzwerkdienste}), the Avahi daemon, and has the
  11030. name service switch service configured to be able to use @code{nss-mdns}
  11031. (@pxref{Name Service Switch, mDNS}).
  11032. @end defvr
  11033. The @var{%desktop-services} variable can be used as the @code{services}
  11034. field of an @code{operating-system} declaration (@pxref{„operating-system“-Referenz, @code{services}}).
  11035. Additionally, the @code{gnome-desktop-service}, @code{xfce-desktop-service},
  11036. @code{mate-desktop-service} and @code{enlightenment-desktop-service-type}
  11037. procedures can add GNOME, XFCE, MATE and/or Enlightenment to a system. To
  11038. ``add GNOME'' means that system-level services like the backlight adjustment
  11039. helpers and the power management utilities are added to the system,
  11040. extending @code{polkit} and @code{dbus} appropriately, allowing GNOME to
  11041. operate with elevated privileges on a limited number of special-purpose
  11042. system interfaces. Additionally, adding a service made by
  11043. @code{gnome-desktop-service} adds the GNOME metapackage to the system
  11044. profile. Likewise, adding the XFCE service not only adds the @code{xfce}
  11045. metapackage to the system profile, but it also gives the Thunar file manager
  11046. the ability to open a ``root-mode'' file management window, if the user
  11047. authenticates using the administrator's password via the standard polkit
  11048. graphical interface. To ``add MATE'' means that @code{polkit} and
  11049. @code{dbus} are extended appropriately, allowing MATE to operate with
  11050. elevated privileges on a limited number of special-purpose system
  11051. interfaces. Additionally, adding a service made by
  11052. @code{mate-desktop-service} adds the MATE metapackage to the system
  11053. profile. ``Adding ENLIGHTENMENT'' means that @code{dbus} is extended
  11054. appropriately, and several of Enlightenment's binaries are set as setuid,
  11055. allowing Enlightenment's screen locker and other functionality to work as
  11056. expetected.
  11057. The desktop environments in Guix use the Xorg display server by default. If
  11058. you'd like to use the newer display server protocol called Wayland, you need
  11059. to use the @code{sddm-service} instead of the @code{slim-service} for the
  11060. graphical login manager. You should then select the ``GNOME (Wayland)''
  11061. session in SDDM. Alternatively you can also try starting GNOME on Wayland
  11062. manually from a TTY with the command ``XDG_SESSION_TYPE=wayland exec
  11063. dbus-run-session gnome-session``. Currently only GNOME has support for
  11064. Wayland.
  11065. @deffn {Scheme Procedure} gnome-desktop-service
  11066. Return a service that adds the @code{gnome} package to the system profile,
  11067. and extends polkit with the actions from @code{gnome-settings-daemon}.
  11068. @end deffn
  11069. @deffn {Scheme Procedure} xfce-desktop-service
  11070. Return a service that adds the @code{xfce} package to the system profile,
  11071. and extends polkit with the ability for @code{thunar} to manipulate the file
  11072. system as root from within a user session, after the user has authenticated
  11073. with the administrator's password.
  11074. @end deffn
  11075. @deffn {Scheme Procedure} mate-desktop-service
  11076. Return a service that adds the @code{mate} package to the system profile,
  11077. and extends polkit with the actions from @code{mate-settings-daemon}.
  11078. @end deffn
  11079. @deffn {Scheme Procedure} enlightenment-desktop-service-type
  11080. Return a service that adds the @code{enlightenment} package to the system
  11081. profile, and extends dbus with actions from @code{efl}.
  11082. @end deffn
  11083. @deftp {Data Type} enlightenment-desktop-service-configuration
  11084. @table @asis
  11085. @item @code{enlightenment} (default @code{enlightenment})
  11086. The enlightenment package to use.
  11087. @end table
  11088. @end deftp
  11089. Because the GNOME, XFCE and MATE desktop services pull in so many packages,
  11090. the default @code{%desktop-services} variable doesn't include any of them by
  11091. default. To add GNOME, XFCE or MATE, just @code{cons} them onto
  11092. @code{%desktop-services} in the @code{services} field of your
  11093. @code{operating-system}:
  11094. @example
  11095. (use-modules (gnu))
  11096. (use-service-modules desktop)
  11097. (operating-system
  11098. ...
  11099. ;; cons* adds items to the list given as its last argument.
  11100. (services (cons* (gnome-desktop-service)
  11101. (xfce-desktop-service)
  11102. %desktop-services))
  11103. ...)
  11104. @end example
  11105. These desktop environments will then be available as options in the
  11106. graphical login window.
  11107. The actual service definitions included in @code{%desktop-services} and
  11108. provided by @code{(gnu services dbus)} and @code{(gnu services desktop)} are
  11109. described below.
  11110. @deffn {Scheme Procedure} dbus-service [#:dbus @var{dbus}] [#:services '()]
  11111. Return a service that runs the ``system bus'', using @var{dbus}, with
  11112. support for @var{services}.
  11113. @uref{http://dbus.freedesktop.org/, D-Bus} is an inter-process communication
  11114. facility. Its system bus is used to allow system services to communicate
  11115. and to be notified of system-wide events.
  11116. @var{services} must be a list of packages that provide an
  11117. @file{etc/dbus-1/system.d} directory containing additional D-Bus
  11118. configuration and policy files. For example, to allow avahi-daemon to use
  11119. the system bus, @var{services} must be equal to @code{(list avahi)}.
  11120. @end deffn
  11121. @deffn {Scheme Procedure} elogind-service [#:config @var{config}]
  11122. Return a service that runs the @code{elogind} login and seat management
  11123. daemon. @uref{https://github.com/elogind/elogind, Elogind} exposes a D-Bus
  11124. interface that can be used to know which users are logged in, know what kind
  11125. of sessions they have open, suspend the system, inhibit system suspend,
  11126. reboot the system, and other tasks.
  11127. Elogind handles most system-level power events for a computer, for example
  11128. suspending the system when a lid is closed, or shutting it down when the
  11129. power button is pressed.
  11130. The @var{config} keyword argument specifies the configuration for elogind,
  11131. and should be the result of an @code{(elogind-configuration (@var{parameter}
  11132. @var{value})...)} invocation. Available parameters and their default values
  11133. are:
  11134. @table @code
  11135. @item kill-user-processes?
  11136. @code{#f}
  11137. @item kill-only-users
  11138. @code{()}
  11139. @item kill-exclude-users
  11140. @code{("root")}
  11141. @item inhibit-delay-max-seconds
  11142. @code{5}
  11143. @item handle-power-key
  11144. @code{poweroff}
  11145. @item handle-suspend-key
  11146. @code{suspend}
  11147. @item handle-hibernate-key
  11148. @code{hibernate}
  11149. @item handle-lid-switch
  11150. @code{suspend}
  11151. @item handle-lid-switch-docked
  11152. @code{ignore}
  11153. @item power-key-ignore-inhibited?
  11154. @code{#f}
  11155. @item suspend-key-ignore-inhibited?
  11156. @code{#f}
  11157. @item hibernate-key-ignore-inhibited?
  11158. @code{#f}
  11159. @item lid-switch-ignore-inhibited?
  11160. @code{#t}
  11161. @item holdoff-timeout-seconds
  11162. @code{30}
  11163. @item idle-action
  11164. @code{ignore}
  11165. @item idle-action-seconds
  11166. @code{(* 30 60)}
  11167. @item runtime-directory-size-percent
  11168. @code{10}
  11169. @item runtime-directory-size
  11170. @code{#f}
  11171. @item remove-ipc?
  11172. @code{#t}
  11173. @item suspend-state
  11174. @code{("mem" "standby" "freeze")}
  11175. @item suspend-mode
  11176. @code{()}
  11177. @item hibernate-state
  11178. @code{("disk")}
  11179. @item hibernate-mode
  11180. @code{("platform" "shutdown")}
  11181. @item hybrid-sleep-state
  11182. @code{("disk")}
  11183. @item hybrid-sleep-mode
  11184. @code{("suspend" "platform" "shutdown")}
  11185. @end table
  11186. @end deffn
  11187. @deffn {Scheme Procedure} accountsservice-service @
  11188. [#:accountsservice @var{accountsservice}] Return a service that runs
  11189. AccountsService, a system service that can list available accounts, change
  11190. their passwords, and so on. AccountsService integrates with PolicyKit to
  11191. enable unprivileged users to acquire the capability to modify their system
  11192. configuration.
  11193. @uref{https://www.freedesktop.org/wiki/Software/AccountsService/, the
  11194. accountsservice web site} for more information.
  11195. The @var{accountsservice} keyword argument is the @code{accountsservice}
  11196. package to expose as a service.
  11197. @end deffn
  11198. @deffn {Scheme Procedure} polkit-service @
  11199. [#:polkit @var{polkit}] Return a service that runs the
  11200. @uref{http://www.freedesktop.org/wiki/Software/polkit/, Polkit privilege
  11201. management service}, which allows system administrators to grant access to
  11202. privileged operations in a structured way. By querying the Polkit service,
  11203. a privileged system component can know when it should grant additional
  11204. capabilities to ordinary users. For example, an ordinary user can be
  11205. granted the capability to suspend the system if the user is logged in
  11206. locally.
  11207. @end deffn
  11208. @deffn {Scheme Procedure} upower-service [#:upower @var{upower}] @
  11209. [#:watts-up-pro? #f] @ [#:poll-batteries? #t] @ [#:ignore-lid? #f] @
  11210. [#:use-percentage-for-policy? #f] @ [#:percentage-low 10] @
  11211. [#:percentage-critical 3] @ [#:percentage-action 2] @ [#:time-low 1200] @
  11212. [#:time-critical 300] @ [#:time-action 120] @ [#:critical-power-action
  11213. 'hybrid-sleep] Return a service that runs
  11214. @uref{http://upower.freedesktop.org/, @command{upowerd}}, a system-wide
  11215. monitor for power consumption and battery levels, with the given
  11216. configuration settings. It implements the @code{org.freedesktop.UPower}
  11217. D-Bus interface, and is notably used by GNOME.
  11218. @end deffn
  11219. @deffn {Scheme Procedure} udisks-service [#:udisks @var{udisks}]
  11220. Return a service for @uref{http://udisks.freedesktop.org/docs/latest/,
  11221. UDisks}, a @dfn{disk management} daemon that provides user interfaces with
  11222. notifications and ways to mount/unmount disks. Programs that talk to UDisks
  11223. include the @command{udisksctl} command, part of UDisks, and GNOME Disks.
  11224. @end deffn
  11225. @deffn {Scheme Procedure} colord-service [#:colord @var{colord}]
  11226. Return a service that runs @command{colord}, a system service with a D-Bus
  11227. interface to manage the color profiles of input and output devices such as
  11228. screens and scanners. It is notably used by the GNOME Color Manager
  11229. graphical tool. See @uref{http://www.freedesktop.org/software/colord/, the
  11230. colord web site} for more information.
  11231. @end deffn
  11232. @deffn {Scheme Procedure} geoclue-application name [#:allowed? #t] [#:system? #f] [#:users '()]
  11233. Return a configuration allowing an application to access GeoClue location
  11234. data. @var{name} is the Desktop ID of the application, without the
  11235. @code{.desktop} part. If @var{allowed?} is true, the application will have
  11236. access to location information by default. The boolean @var{system?} value
  11237. indicates whether an application is a system component or not. Finally
  11238. @var{users} is a list of UIDs of all users for which this application is
  11239. allowed location info access. An empty users list means that all users are
  11240. allowed.
  11241. @end deffn
  11242. @defvr {Scheme Variable} %standard-geoclue-applications
  11243. The standard list of well-known GeoClue application configurations, granting
  11244. authority to the GNOME date-and-time utility to ask for the current location
  11245. in order to set the time zone, and allowing the IceCat and Epiphany web
  11246. browsers to request location information. IceCat and Epiphany both query
  11247. the user before allowing a web page to know the user's location.
  11248. @end defvr
  11249. @deffn {Scheme Procedure} geoclue-service [#:colord @var{colord}] @
  11250. [#:whitelist '()] @ [#:wifi-geolocation-url
  11251. "https://location.services.mozilla.com/v1/geolocate?key=geoclue"] @
  11252. [#:submit-data? #f] [#:wifi-submission-url
  11253. "https://location.services.mozilla.com/v1/submit?key=geoclue"] @
  11254. [#:submission-nick "geoclue"] @ [#:applications
  11255. %standard-geoclue-applications] Return a service that runs the GeoClue
  11256. location service. This service provides a D-Bus interface to allow
  11257. applications to request access to a user's physical location, and optionally
  11258. to add information to online location databases. See
  11259. @uref{https://wiki.freedesktop.org/www/Software/GeoClue/, the GeoClue web
  11260. site} for more information.
  11261. @end deffn
  11262. @deffn {Scheme Procedure} bluetooth-service [#:bluez @var{bluez}] @
  11263. [@w{#:auto-enable? #f}] Return a service that runs the @command{bluetoothd}
  11264. daemon, which manages all the Bluetooth devices and provides a number of
  11265. D-Bus interfaces. When AUTO-ENABLE? is true, the bluetooth controller is
  11266. powered automatically at boot, which can be useful when using a bluetooth
  11267. keyboard or mouse.
  11268. Users need to be in the @code{lp} group to access the D-Bus service.
  11269. @end deffn
  11270. @node Sound Services
  11271. @subsubsection Sound Services
  11272. @cindex sound support
  11273. @cindex ALSA
  11274. @cindex PulseAudio, sound support
  11275. The @code{(gnu services sound)} module provides a service to configure the
  11276. Advanced Linux Sound Architecture (ALSA) system, which makes PulseAudio the
  11277. preferred ALSA output driver.
  11278. @deffn {Scheme Variable} alsa-service-type
  11279. This is the type for the @uref{https://alsa-project.org/, Advanced Linux
  11280. Sound Architecture} (ALSA) system, which generates the
  11281. @file{/etc/asound.conf} configuration file. The value for this type is a
  11282. @command{alsa-configuration} record as in this example:
  11283. @example
  11284. (service alsa-service-type)
  11285. @end example
  11286. See below for details about @code{alsa-configuration}.
  11287. @end deffn
  11288. @deftp {Data Type} alsa-configuration
  11289. Data type representing the configuration for @code{alsa-service}.
  11290. @table @asis
  11291. @item @code{alsa-plugins} (default: @var{alsa-plugins})
  11292. @code{alsa-plugins} package to use.
  11293. @item @code{pulseaudio?} (default: @var{#t})
  11294. Whether ALSA applications should transparently be made to use the
  11295. @uref{http://www.pulseaudio.org/, PulseAudio} sound server.
  11296. Using PulseAudio allows you to run several sound-producing applications at
  11297. the same time and to individual control them @i{via} @command{pavucontrol},
  11298. among other things.
  11299. @item @code{extra-options} (default: @var{""})
  11300. String to append to the @file{/etc/asound.conf} file.
  11301. @end table
  11302. @end deftp
  11303. Individual users who want to override the system configuration of ALSA can
  11304. do it with the @file{~/.asoundrc} file:
  11305. @example
  11306. # In guix, we have to specify the absolute path for plugins.
  11307. pcm_type.jack @{
  11308. lib "/home/alice/.guix-profile/lib/alsa-lib/libasound_module_pcm_jack.so"
  11309. @}
  11310. # Routing ALSA to jack:
  11311. # <http://jackaudio.org/faq/routing_alsa.html>.
  11312. pcm.rawjack @{
  11313. type jack
  11314. playback_ports @{
  11315. 0 system:playback_1
  11316. 1 system:playback_2
  11317. @}
  11318. capture_ports @{
  11319. 0 system:capture_1
  11320. 1 system:capture_2
  11321. @}
  11322. @}
  11323. pcm.!default @{
  11324. type plug
  11325. slave @{
  11326. pcm "rawjack"
  11327. @}
  11328. @}
  11329. @end example
  11330. See @uref{https://www.alsa-project.org/main/index.php/Asoundrc} for the
  11331. details.
  11332. @node Datenbankdienste
  11333. @subsubsection Datenbankdienste
  11334. @cindex database
  11335. @cindex SQL
  11336. The @code{(gnu services databases)} module provides the following services.
  11337. @deffn {Scheme Procedure} postgresql-service [#:postgresql postgresql] @
  11338. [#:config-file] [#:data-directory ``/var/lib/postgresql/data''] @ [#:port
  11339. 5432] [#:locale ``en_US.utf8''] Return a service that runs @var{postgresql},
  11340. the PostgreSQL database server.
  11341. The PostgreSQL daemon loads its runtime configuration from
  11342. @var{config-file}, creates a database cluster with @var{locale} as the
  11343. default locale, stored in @var{data-directory}. It then listens on
  11344. @var{port}.
  11345. @end deffn
  11346. @deffn {Scheme Procedure} mysql-service [#:config (mysql-configuration)]
  11347. Return a service that runs @command{mysqld}, the MySQL or MariaDB database
  11348. server.
  11349. The optional @var{config} argument specifies the configuration for
  11350. @command{mysqld}, which should be a @code{<mysql-configuration>} object.
  11351. @end deffn
  11352. @deftp {Data Type} mysql-configuration
  11353. Data type representing the configuration of @var{mysql-service}.
  11354. @table @asis
  11355. @item @code{mysql} (default: @var{mariadb})
  11356. Package object of the MySQL database server, can be either @var{mariadb} or
  11357. @var{mysql}.
  11358. For MySQL, a temporary root password will be displayed at activation time.
  11359. For MariaDB, the root password is empty.
  11360. @item @code{port} (default: @code{3306})
  11361. TCP port on which the database server listens for incoming connections.
  11362. @end table
  11363. @end deftp
  11364. @defvr {Scheme Variable} memcached-service-type
  11365. This is the service type for the @uref{https://memcached.org/, Memcached}
  11366. service, which provides a distributed in memory cache. The value for the
  11367. service type is a @code{memcached-configuration} object.
  11368. @end defvr
  11369. @example
  11370. (service memcached-service-type)
  11371. @end example
  11372. @deftp {Data Type} memcached-configuration
  11373. Data type representing the configuration of memcached.
  11374. @table @asis
  11375. @item @code{memcached} (default: @code{memcached})
  11376. The Memcached package to use.
  11377. @item @code{interfaces} (default: @code{'("0.0.0.0")})
  11378. Network interfaces on which to listen.
  11379. @item @code{tcp-port} (default: @code{11211})
  11380. Port on which to accept connections on,
  11381. @item @code{udp-port} (default: @code{11211})
  11382. Port on which to accept UDP connections on, a value of 0 will disable
  11383. listening on a UDP socket.
  11384. @item @code{additional-options} (default: @code{'()})
  11385. Additional command line options to pass to @code{memcached}.
  11386. @end table
  11387. @end deftp
  11388. @defvr {Scheme Variable} mongodb-service-type
  11389. This is the service type for @uref{https://www.mongodb.com/, MongoDB}. The
  11390. value for the service type is a @code{mongodb-configuration} object.
  11391. @end defvr
  11392. @example
  11393. (service mongodb-service-type)
  11394. @end example
  11395. @deftp {Data Type} mongodb-configuration
  11396. Data type representing the configuration of mongodb.
  11397. @table @asis
  11398. @item @code{mongodb} (default: @code{mongodb})
  11399. The MongoDB package to use.
  11400. @item @code{config-file} (default: @code{%default-mongodb-configuration-file})
  11401. The configuration file for MongoDB.
  11402. @item @code{data-directory} (default: @code{"/var/lib/mongodb"})
  11403. This value is used to create the directory, so that it exists and is owned
  11404. by the mongodb user. It should match the data-directory which MongoDB is
  11405. configured to use through the configuration file.
  11406. @end table
  11407. @end deftp
  11408. @defvr {Scheme Variable} redis-service-type
  11409. This is the service type for the @uref{https://redis.io/, Redis} key/value
  11410. store, whose value is a @code{redis-configuration} object.
  11411. @end defvr
  11412. @deftp {Data Type} redis-configuration
  11413. Data type representing the configuration of redis.
  11414. @table @asis
  11415. @item @code{redis} (default: @code{redis})
  11416. The Redis package to use.
  11417. @item @code{bind} (default: @code{"127.0.0.1"})
  11418. Network interface on which to listen.
  11419. @item @code{port} (default: @code{6379})
  11420. Port on which to accept connections on, a value of 0 will disable listening
  11421. on a TCP socket.
  11422. @item @code{working-directory} (default: @code{"/var/lib/redis"})
  11423. Directory in which to store the database and related files.
  11424. @end table
  11425. @end deftp
  11426. @node Mail-Dienste
  11427. @subsubsection Mail-Dienste
  11428. @cindex mail
  11429. @cindex email
  11430. The @code{(gnu services mail)} module provides Guix service definitions for
  11431. email services: IMAP, POP3, and LMTP servers, as well as mail transport
  11432. agents (MTAs). Lots of acronyms! These services are detailed in the
  11433. subsections below.
  11434. @subsubheading Dovecot Service
  11435. @deffn {Scheme Procedure} dovecot-service [#:config (dovecot-configuration)]
  11436. Return a service that runs the Dovecot IMAP/POP3/LMTP mail server.
  11437. @end deffn
  11438. By default, Dovecot does not need much configuration; the default
  11439. configuration object created by @code{(dovecot-configuration)} will suffice
  11440. if your mail is delivered to @code{~/Maildir}. A self-signed certificate
  11441. will be generated for TLS-protected connections, though Dovecot will also
  11442. listen on cleartext ports by default. There are a number of options,
  11443. though, which mail administrators might need to change, and as is the case
  11444. with other services, Guix allows the system administrator to specify these
  11445. parameters via a uniform Scheme interface.
  11446. For example, to specify that mail is located at @code{maildir~/.mail}, one
  11447. would instantiate the Dovecot service like this:
  11448. @example
  11449. (dovecot-service #:config
  11450. (dovecot-configuration
  11451. (mail-location "maildir:~/.mail")))
  11452. @end example
  11453. The available configuration parameters follow. Each parameter definition is
  11454. preceded by its type; for example, @samp{string-list foo} indicates that the
  11455. @code{foo} parameter should be specified as a list of strings. There is
  11456. also a way to specify the configuration as a string, if you have an old
  11457. @code{dovecot.conf} file that you want to port over from some other system;
  11458. see the end for more details.
  11459. @c The following documentation was initially generated by
  11460. @c (generate-documentation) in (gnu services mail). Manually maintained
  11461. @c documentation is better, so we shouldn't hesitate to edit below as
  11462. @c needed. However if the change you want to make to this documentation
  11463. @c can be done in an automated way, it's probably easier to change
  11464. @c (generate-documentation) than to make it below and have to deal with
  11465. @c the churn as dovecot updates.
  11466. Available @code{dovecot-configuration} fields are:
  11467. @deftypevr {@code{dovecot-configuration} parameter} package dovecot
  11468. The dovecot package.
  11469. @end deftypevr
  11470. @deftypevr {@code{dovecot-configuration} parameter} comma-separated-string-list listen
  11471. A list of IPs or hosts where to listen for connections. @samp{*} listens on
  11472. all IPv4 interfaces, @samp{::} listens on all IPv6 interfaces. If you want
  11473. to specify non-default ports or anything more complex, customize the address
  11474. and port fields of the @samp{inet-listener} of the specific services you are
  11475. interested in.
  11476. @end deftypevr
  11477. @deftypevr {@code{dovecot-configuration} parameter} protocol-configuration-list protocols
  11478. List of protocols we want to serve. Available protocols include
  11479. @samp{imap}, @samp{pop3}, and @samp{lmtp}.
  11480. Available @code{protocol-configuration} fields are:
  11481. @deftypevr {@code{protocol-configuration} parameter} string name
  11482. The name of the protocol.
  11483. @end deftypevr
  11484. @deftypevr {@code{protocol-configuration} parameter} string auth-socket-path
  11485. UNIX socket path to the master authentication server to find users. This is
  11486. used by imap (for shared users) and lda. It defaults to
  11487. @samp{"/var/run/dovecot/auth-userdb"}.
  11488. @end deftypevr
  11489. @deftypevr {@code{protocol-configuration} parameter} space-separated-string-list mail-plugins
  11490. Space separated list of plugins to load.
  11491. @end deftypevr
  11492. @deftypevr {@code{protocol-configuration} parameter} non-negative-integer mail-max-userip-connections
  11493. Maximum number of IMAP connections allowed for a user from each IP address.
  11494. NOTE: The username is compared case-sensitively. Defaults to @samp{10}.
  11495. @end deftypevr
  11496. @end deftypevr
  11497. @deftypevr {@code{dovecot-configuration} parameter} service-configuration-list services
  11498. List of services to enable. Available services include @samp{imap},
  11499. @samp{imap-login}, @samp{pop3}, @samp{pop3-login}, @samp{auth}, and
  11500. @samp{lmtp}.
  11501. Available @code{service-configuration} fields are:
  11502. @deftypevr {@code{service-configuration} parameter} string kind
  11503. The service kind. Valid values include @code{director}, @code{imap-login},
  11504. @code{pop3-login}, @code{lmtp}, @code{imap}, @code{pop3}, @code{auth},
  11505. @code{auth-worker}, @code{dict}, @code{tcpwrap}, @code{quota-warning}, or
  11506. anything else.
  11507. @end deftypevr
  11508. @deftypevr {@code{service-configuration} parameter} listener-configuration-list listeners
  11509. Listeners for the service. A listener is either a
  11510. @code{unix-listener-configuration}, a @code{fifo-listener-configuration}, or
  11511. an @code{inet-listener-configuration}. Defaults to @samp{()}.
  11512. Available @code{unix-listener-configuration} fields are:
  11513. @deftypevr {@code{unix-listener-configuration} parameter} string path
  11514. Path to the file, relative to @code{base-dir} field. This is also used as
  11515. the section name.
  11516. @end deftypevr
  11517. @deftypevr {@code{unix-listener-configuration} parameter} string mode
  11518. The access mode for the socket. Defaults to @samp{"0600"}.
  11519. @end deftypevr
  11520. @deftypevr {@code{unix-listener-configuration} parameter} string user
  11521. The user to own the socket. Defaults to @samp{""}.
  11522. @end deftypevr
  11523. @deftypevr {@code{unix-listener-configuration} parameter} string group
  11524. The group to own the socket. Defaults to @samp{""}.
  11525. @end deftypevr
  11526. Available @code{fifo-listener-configuration} fields are:
  11527. @deftypevr {@code{fifo-listener-configuration} parameter} string path
  11528. Path to the file, relative to @code{base-dir} field. This is also used as
  11529. the section name.
  11530. @end deftypevr
  11531. @deftypevr {@code{fifo-listener-configuration} parameter} string mode
  11532. The access mode for the socket. Defaults to @samp{"0600"}.
  11533. @end deftypevr
  11534. @deftypevr {@code{fifo-listener-configuration} parameter} string user
  11535. The user to own the socket. Defaults to @samp{""}.
  11536. @end deftypevr
  11537. @deftypevr {@code{fifo-listener-configuration} parameter} string group
  11538. The group to own the socket. Defaults to @samp{""}.
  11539. @end deftypevr
  11540. Available @code{inet-listener-configuration} fields are:
  11541. @deftypevr {@code{inet-listener-configuration} parameter} string protocol
  11542. The protocol to listen for.
  11543. @end deftypevr
  11544. @deftypevr {@code{inet-listener-configuration} parameter} string address
  11545. The address on which to listen, or empty for all addresses. Defaults to
  11546. @samp{""}.
  11547. @end deftypevr
  11548. @deftypevr {@code{inet-listener-configuration} parameter} non-negative-integer port
  11549. The port on which to listen.
  11550. @end deftypevr
  11551. @deftypevr {@code{inet-listener-configuration} parameter} boolean ssl?
  11552. Whether to use SSL for this service; @samp{yes}, @samp{no}, or
  11553. @samp{required}. Defaults to @samp{#t}.
  11554. @end deftypevr
  11555. @end deftypevr
  11556. @deftypevr {@code{service-configuration} parameter} non-negative-integer client-limit
  11557. Maximum number of simultaneous client connections per process. Once this
  11558. number of connections is received, the next incoming connection will prompt
  11559. Dovecot to spawn another process. If set to 0, @code{default-client-limit}
  11560. is used instead.
  11561. Defaults to @samp{0}.
  11562. @end deftypevr
  11563. @deftypevr {@code{service-configuration} parameter} non-negative-integer service-count
  11564. Number of connections to handle before starting a new process. Typically
  11565. the only useful values are 0 (unlimited) or 1. 1 is more secure, but 0 is
  11566. faster. <doc/wiki/LoginProcess.txt>. Defaults to @samp{1}.
  11567. @end deftypevr
  11568. @deftypevr {@code{service-configuration} parameter} non-negative-integer process-limit
  11569. Maximum number of processes that can exist for this service. If set to 0,
  11570. @code{default-process-limit} is used instead.
  11571. Defaults to @samp{0}.
  11572. @end deftypevr
  11573. @deftypevr {@code{service-configuration} parameter} non-negative-integer process-min-avail
  11574. Number of processes to always keep waiting for more connections. Defaults
  11575. to @samp{0}.
  11576. @end deftypevr
  11577. @deftypevr {@code{service-configuration} parameter} non-negative-integer vsz-limit
  11578. If you set @samp{service-count 0}, you probably need to grow this. Defaults
  11579. to @samp{256000000}.
  11580. @end deftypevr
  11581. @end deftypevr
  11582. @deftypevr {@code{dovecot-configuration} parameter} dict-configuration dict
  11583. Dict configuration, as created by the @code{dict-configuration} constructor.
  11584. Available @code{dict-configuration} fields are:
  11585. @deftypevr {@code{dict-configuration} parameter} free-form-fields entries
  11586. A list of key-value pairs that this dict should hold. Defaults to
  11587. @samp{()}.
  11588. @end deftypevr
  11589. @end deftypevr
  11590. @deftypevr {@code{dovecot-configuration} parameter} passdb-configuration-list passdbs
  11591. A list of passdb configurations, each one created by the
  11592. @code{passdb-configuration} constructor.
  11593. Available @code{passdb-configuration} fields are:
  11594. @deftypevr {@code{passdb-configuration} parameter} string driver
  11595. The driver that the passdb should use. Valid values include @samp{pam},
  11596. @samp{passwd}, @samp{shadow}, @samp{bsdauth}, and @samp{static}. Defaults
  11597. to @samp{"pam"}.
  11598. @end deftypevr
  11599. @deftypevr {@code{passdb-configuration} parameter} space-separated-string-list args
  11600. Space separated list of arguments to the passdb driver. Defaults to
  11601. @samp{""}.
  11602. @end deftypevr
  11603. @end deftypevr
  11604. @deftypevr {@code{dovecot-configuration} parameter} userdb-configuration-list userdbs
  11605. List of userdb configurations, each one created by the
  11606. @code{userdb-configuration} constructor.
  11607. Available @code{userdb-configuration} fields are:
  11608. @deftypevr {@code{userdb-configuration} parameter} string driver
  11609. The driver that the userdb should use. Valid values include @samp{passwd}
  11610. and @samp{static}. Defaults to @samp{"passwd"}.
  11611. @end deftypevr
  11612. @deftypevr {@code{userdb-configuration} parameter} space-separated-string-list args
  11613. Space separated list of arguments to the userdb driver. Defaults to
  11614. @samp{""}.
  11615. @end deftypevr
  11616. @deftypevr {@code{userdb-configuration} parameter} free-form-args override-fields
  11617. Override fields from passwd. Defaults to @samp{()}.
  11618. @end deftypevr
  11619. @end deftypevr
  11620. @deftypevr {@code{dovecot-configuration} parameter} plugin-configuration plugin-configuration
  11621. Plug-in configuration, created by the @code{plugin-configuration}
  11622. constructor.
  11623. @end deftypevr
  11624. @deftypevr {@code{dovecot-configuration} parameter} list-of-namespace-configuration namespaces
  11625. List of namespaces. Each item in the list is created by the
  11626. @code{namespace-configuration} constructor.
  11627. Available @code{namespace-configuration} fields are:
  11628. @deftypevr {@code{namespace-configuration} parameter} string name
  11629. Name for this namespace.
  11630. @end deftypevr
  11631. @deftypevr {@code{namespace-configuration} parameter} string type
  11632. Namespace type: @samp{private}, @samp{shared} or @samp{public}. Defaults to
  11633. @samp{"private"}.
  11634. @end deftypevr
  11635. @deftypevr {@code{namespace-configuration} parameter} string separator
  11636. Hierarchy separator to use. You should use the same separator for all
  11637. namespaces or some clients get confused. @samp{/} is usually a good one.
  11638. The default however depends on the underlying mail storage format. Defaults
  11639. to @samp{""}.
  11640. @end deftypevr
  11641. @deftypevr {@code{namespace-configuration} parameter} string prefix
  11642. Prefix required to access this namespace. This needs to be different for
  11643. all namespaces. For example @samp{Public/}. Defaults to @samp{""}.
  11644. @end deftypevr
  11645. @deftypevr {@code{namespace-configuration} parameter} string location
  11646. Physical location of the mailbox. This is in the same format as
  11647. mail_location, which is also the default for it. Defaults to @samp{""}.
  11648. @end deftypevr
  11649. @deftypevr {@code{namespace-configuration} parameter} boolean inbox?
  11650. There can be only one INBOX, and this setting defines which namespace has
  11651. it. Defaults to @samp{#f}.
  11652. @end deftypevr
  11653. @deftypevr {@code{namespace-configuration} parameter} boolean hidden?
  11654. If namespace is hidden, it's not advertised to clients via NAMESPACE
  11655. extension. You'll most likely also want to set @samp{list? #f}. This is
  11656. mostly useful when converting from another server with different namespaces
  11657. which you want to deprecate but still keep working. For example you can
  11658. create hidden namespaces with prefixes @samp{~/mail/}, @samp{~%u/mail/} and
  11659. @samp{mail/}. Defaults to @samp{#f}.
  11660. @end deftypevr
  11661. @deftypevr {@code{namespace-configuration} parameter} boolean list?
  11662. Show the mailboxes under this namespace with the LIST command. This makes
  11663. the namespace visible for clients that do not support the NAMESPACE
  11664. extension. The special @code{children} value lists child mailboxes, but
  11665. hides the namespace prefix. Defaults to @samp{#t}.
  11666. @end deftypevr
  11667. @deftypevr {@code{namespace-configuration} parameter} boolean subscriptions?
  11668. Namespace handles its own subscriptions. If set to @code{#f}, the parent
  11669. namespace handles them. The empty prefix should always have this as
  11670. @code{#t}). Defaults to @samp{#t}.
  11671. @end deftypevr
  11672. @deftypevr {@code{namespace-configuration} parameter} mailbox-configuration-list mailboxes
  11673. List of predefined mailboxes in this namespace. Defaults to @samp{()}.
  11674. Available @code{mailbox-configuration} fields are:
  11675. @deftypevr {@code{mailbox-configuration} parameter} string name
  11676. Name for this mailbox.
  11677. @end deftypevr
  11678. @deftypevr {@code{mailbox-configuration} parameter} string auto
  11679. @samp{create} will automatically create this mailbox. @samp{subscribe} will
  11680. both create and subscribe to the mailbox. Defaults to @samp{"no"}.
  11681. @end deftypevr
  11682. @deftypevr {@code{mailbox-configuration} parameter} space-separated-string-list special-use
  11683. List of IMAP @code{SPECIAL-USE} attributes as specified by RFC 6154. Valid
  11684. values are @code{\All}, @code{\Archive}, @code{\Drafts}, @code{\Flagged},
  11685. @code{\Junk}, @code{\Sent}, and @code{\Trash}. Defaults to @samp{()}.
  11686. @end deftypevr
  11687. @end deftypevr
  11688. @end deftypevr
  11689. @deftypevr {@code{dovecot-configuration} parameter} file-name base-dir
  11690. Base directory where to store runtime data. Defaults to
  11691. @samp{"/var/run/dovecot/"}.
  11692. @end deftypevr
  11693. @deftypevr {@code{dovecot-configuration} parameter} string login-greeting
  11694. Greeting message for clients. Defaults to @samp{"Dovecot ready."}.
  11695. @end deftypevr
  11696. @deftypevr {@code{dovecot-configuration} parameter} space-separated-string-list login-trusted-networks
  11697. List of trusted network ranges. Connections from these IPs are allowed to
  11698. override their IP addresses and ports (for logging and for authentication
  11699. checks). @samp{disable-plaintext-auth} is also ignored for these networks.
  11700. Typically you would specify your IMAP proxy servers here. Defaults to
  11701. @samp{()}.
  11702. @end deftypevr
  11703. @deftypevr {@code{dovecot-configuration} parameter} space-separated-string-list login-access-sockets
  11704. List of login access check sockets (e.g.@: tcpwrap). Defaults to @samp{()}.
  11705. @end deftypevr
  11706. @deftypevr {@code{dovecot-configuration} parameter} boolean verbose-proctitle?
  11707. Show more verbose process titles (in ps). Currently shows user name and IP
  11708. address. Useful for seeing who is actually using the IMAP processes (e.g.@:
  11709. shared mailboxes or if the same uid is used for multiple accounts).
  11710. Defaults to @samp{#f}.
  11711. @end deftypevr
  11712. @deftypevr {@code{dovecot-configuration} parameter} boolean shutdown-clients?
  11713. Should all processes be killed when Dovecot master process shuts down.
  11714. Setting this to @code{#f} means that Dovecot can be upgraded without forcing
  11715. existing client connections to close (although that could also be a problem
  11716. if the upgrade is e.g.@: due to a security fix). Defaults to @samp{#t}.
  11717. @end deftypevr
  11718. @deftypevr {@code{dovecot-configuration} parameter} non-negative-integer doveadm-worker-count
  11719. If non-zero, run mail commands via this many connections to doveadm server,
  11720. instead of running them directly in the same process. Defaults to @samp{0}.
  11721. @end deftypevr
  11722. @deftypevr {@code{dovecot-configuration} parameter} string doveadm-socket-path
  11723. UNIX socket or host:port used for connecting to doveadm server. Defaults to
  11724. @samp{"doveadm-server"}.
  11725. @end deftypevr
  11726. @deftypevr {@code{dovecot-configuration} parameter} space-separated-string-list import-environment
  11727. List of environment variables that are preserved on Dovecot startup and
  11728. passed down to all of its child processes. You can also give key=value
  11729. pairs to always set specific settings.
  11730. @end deftypevr
  11731. @deftypevr {@code{dovecot-configuration} parameter} boolean disable-plaintext-auth?
  11732. Disable LOGIN command and all other plaintext authentications unless SSL/TLS
  11733. is used (LOGINDISABLED capability). Note that if the remote IP matches the
  11734. local IP (i.e.@: you're connecting from the same computer), the connection
  11735. is considered secure and plaintext authentication is allowed. See also
  11736. ssl=required setting. Defaults to @samp{#t}.
  11737. @end deftypevr
  11738. @deftypevr {@code{dovecot-configuration} parameter} non-negative-integer auth-cache-size
  11739. Authentication cache size (e.g.@: @samp{#e10e6}). 0 means it's disabled.
  11740. Note that bsdauth, PAM and vpopmail require @samp{cache-key} to be set for
  11741. caching to be used. Defaults to @samp{0}.
  11742. @end deftypevr
  11743. @deftypevr {@code{dovecot-configuration} parameter} string auth-cache-ttl
  11744. Time to live for cached data. After TTL expires the cached record is no
  11745. longer used, *except* if the main database lookup returns internal failure.
  11746. We also try to handle password changes automatically: If user's previous
  11747. authentication was successful, but this one wasn't, the cache isn't used.
  11748. For now this works only with plaintext authentication. Defaults to @samp{"1
  11749. hour"}.
  11750. @end deftypevr
  11751. @deftypevr {@code{dovecot-configuration} parameter} string auth-cache-negative-ttl
  11752. TTL for negative hits (user not found, password mismatch). 0 disables
  11753. caching them completely. Defaults to @samp{"1 hour"}.
  11754. @end deftypevr
  11755. @deftypevr {@code{dovecot-configuration} parameter} space-separated-string-list auth-realms
  11756. List of realms for SASL authentication mechanisms that need them. You can
  11757. leave it empty if you don't want to support multiple realms. Many clients
  11758. simply use the first one listed here, so keep the default realm first.
  11759. Defaults to @samp{()}.
  11760. @end deftypevr
  11761. @deftypevr {@code{dovecot-configuration} parameter} string auth-default-realm
  11762. Default realm/domain to use if none was specified. This is used for both
  11763. SASL realms and appending @@domain to username in plaintext logins.
  11764. Defaults to @samp{""}.
  11765. @end deftypevr
  11766. @deftypevr {@code{dovecot-configuration} parameter} string auth-username-chars
  11767. List of allowed characters in username. If the user-given username contains
  11768. a character not listed in here, the login automatically fails. This is just
  11769. an extra check to make sure user can't exploit any potential quote escaping
  11770. vulnerabilities with SQL/LDAP databases. If you want to allow all
  11771. characters, set this value to empty. Defaults to
  11772. @samp{"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890.-_@@"}.
  11773. @end deftypevr
  11774. @deftypevr {@code{dovecot-configuration} parameter} string auth-username-translation
  11775. Username character translations before it's looked up from databases. The
  11776. value contains series of from -> to characters. For example @samp{#@@/@@}
  11777. means that @samp{#} and @samp{/} characters are translated to @samp{@@}.
  11778. Defaults to @samp{""}.
  11779. @end deftypevr
  11780. @deftypevr {@code{dovecot-configuration} parameter} string auth-username-format
  11781. Username formatting before it's looked up from databases. You can use the
  11782. standard variables here, e.g.@: %Lu would lowercase the username, %n would
  11783. drop away the domain if it was given, or @samp{%n-AT-%d} would change the
  11784. @samp{@@} into @samp{-AT-}. This translation is done after
  11785. @samp{auth-username-translation} changes. Defaults to @samp{"%Lu"}.
  11786. @end deftypevr
  11787. @deftypevr {@code{dovecot-configuration} parameter} string auth-master-user-separator
  11788. If you want to allow master users to log in by specifying the master
  11789. username within the normal username string (i.e.@: not using SASL
  11790. mechanism's support for it), you can specify the separator character here.
  11791. The format is then <username><separator><master username>. UW-IMAP uses
  11792. @samp{*} as the separator, so that could be a good choice. Defaults to
  11793. @samp{""}.
  11794. @end deftypevr
  11795. @deftypevr {@code{dovecot-configuration} parameter} string auth-anonymous-username
  11796. Username to use for users logging in with ANONYMOUS SASL mechanism.
  11797. Defaults to @samp{"anonymous"}.
  11798. @end deftypevr
  11799. @deftypevr {@code{dovecot-configuration} parameter} non-negative-integer auth-worker-max-count
  11800. Maximum number of dovecot-auth worker processes. They're used to execute
  11801. blocking passdb and userdb queries (e.g.@: MySQL and PAM). They're
  11802. automatically created and destroyed as needed. Defaults to @samp{30}.
  11803. @end deftypevr
  11804. @deftypevr {@code{dovecot-configuration} parameter} string auth-gssapi-hostname
  11805. Host name to use in GSSAPI principal names. The default is to use the name
  11806. returned by gethostname(). Use @samp{$ALL} (with quotes) to allow all
  11807. keytab entries. Defaults to @samp{""}.
  11808. @end deftypevr
  11809. @deftypevr {@code{dovecot-configuration} parameter} string auth-krb5-keytab
  11810. Kerberos keytab to use for the GSSAPI mechanism. Will use the system
  11811. default (usually @file{/etc/krb5.keytab}) if not specified. You may need to
  11812. change the auth service to run as root to be able to read this file.
  11813. Defaults to @samp{""}.
  11814. @end deftypevr
  11815. @deftypevr {@code{dovecot-configuration} parameter} boolean auth-use-winbind?
  11816. Do NTLM and GSS-SPNEGO authentication using Samba's winbind daemon and
  11817. @samp{ntlm-auth} helper. <doc/wiki/Authentication/Mechanisms/Winbind.txt>.
  11818. Defaults to @samp{#f}.
  11819. @end deftypevr
  11820. @deftypevr {@code{dovecot-configuration} parameter} file-name auth-winbind-helper-path
  11821. Path for Samba's @samp{ntlm-auth} helper binary. Defaults to
  11822. @samp{"/usr/bin/ntlm_auth"}.
  11823. @end deftypevr
  11824. @deftypevr {@code{dovecot-configuration} parameter} string auth-failure-delay
  11825. Time to delay before replying to failed authentications. Defaults to
  11826. @samp{"2 secs"}.
  11827. @end deftypevr
  11828. @deftypevr {@code{dovecot-configuration} parameter} boolean auth-ssl-require-client-cert?
  11829. Require a valid SSL client certificate or the authentication fails.
  11830. Defaults to @samp{#f}.
  11831. @end deftypevr
  11832. @deftypevr {@code{dovecot-configuration} parameter} boolean auth-ssl-username-from-cert?
  11833. Take the username from client's SSL certificate, using
  11834. @code{X509_NAME_get_text_by_NID()} which returns the subject's DN's
  11835. CommonName. Defaults to @samp{#f}.
  11836. @end deftypevr
  11837. @deftypevr {@code{dovecot-configuration} parameter} space-separated-string-list auth-mechanisms
  11838. List of wanted authentication mechanisms. Supported mechanisms are:
  11839. @samp{plain}, @samp{login}, @samp{digest-md5}, @samp{cram-md5}, @samp{ntlm},
  11840. @samp{rpa}, @samp{apop}, @samp{anonymous}, @samp{gssapi}, @samp{otp},
  11841. @samp{skey}, and @samp{gss-spnego}. NOTE: See also
  11842. @samp{disable-plaintext-auth} setting.
  11843. @end deftypevr
  11844. @deftypevr {@code{dovecot-configuration} parameter} space-separated-string-list director-servers
  11845. List of IPs or hostnames to all director servers, including ourself. Ports
  11846. can be specified as ip:port. The default port is the same as what director
  11847. service's @samp{inet-listener} is using. Defaults to @samp{()}.
  11848. @end deftypevr
  11849. @deftypevr {@code{dovecot-configuration} parameter} space-separated-string-list director-mail-servers
  11850. List of IPs or hostnames to all backend mail servers. Ranges are allowed
  11851. too, like 10.0.0.10-10.0.0.30. Defaults to @samp{()}.
  11852. @end deftypevr
  11853. @deftypevr {@code{dovecot-configuration} parameter} string director-user-expire
  11854. How long to redirect users to a specific server after it no longer has any
  11855. connections. Defaults to @samp{"15 min"}.
  11856. @end deftypevr
  11857. @deftypevr {@code{dovecot-configuration} parameter} string director-username-hash
  11858. How the username is translated before being hashed. Useful values include
  11859. %Ln if user can log in with or without @@domain, %Ld if mailboxes are shared
  11860. within domain. Defaults to @samp{"%Lu"}.
  11861. @end deftypevr
  11862. @deftypevr {@code{dovecot-configuration} parameter} string log-path
  11863. Log file to use for error messages. @samp{syslog} logs to syslog,
  11864. @samp{/dev/stderr} logs to stderr. Defaults to @samp{"syslog"}.
  11865. @end deftypevr
  11866. @deftypevr {@code{dovecot-configuration} parameter} string info-log-path
  11867. Log file to use for informational messages. Defaults to @samp{log-path}.
  11868. Defaults to @samp{""}.
  11869. @end deftypevr
  11870. @deftypevr {@code{dovecot-configuration} parameter} string debug-log-path
  11871. Log file to use for debug messages. Defaults to @samp{info-log-path}.
  11872. Defaults to @samp{""}.
  11873. @end deftypevr
  11874. @deftypevr {@code{dovecot-configuration} parameter} string syslog-facility
  11875. Syslog facility to use if you're logging to syslog. Usually if you don't
  11876. want to use @samp{mail}, you'll use local0..local7. Also other standard
  11877. facilities are supported. Defaults to @samp{"mail"}.
  11878. @end deftypevr
  11879. @deftypevr {@code{dovecot-configuration} parameter} boolean auth-verbose?
  11880. Log unsuccessful authentication attempts and the reasons why they failed.
  11881. Defaults to @samp{#f}.
  11882. @end deftypevr
  11883. @deftypevr {@code{dovecot-configuration} parameter} boolean auth-verbose-passwords?
  11884. In case of password mismatches, log the attempted password. Valid values
  11885. are no, plain and sha1. sha1 can be useful for detecting brute force
  11886. password attempts vs. user simply trying the same password over and over
  11887. again. You can also truncate the value to n chars by appending ":n" (e.g.@:
  11888. sha1:6). Defaults to @samp{#f}.
  11889. @end deftypevr
  11890. @deftypevr {@code{dovecot-configuration} parameter} boolean auth-debug?
  11891. Even more verbose logging for debugging purposes. Shows for example SQL
  11892. queries. Defaults to @samp{#f}.
  11893. @end deftypevr
  11894. @deftypevr {@code{dovecot-configuration} parameter} boolean auth-debug-passwords?
  11895. In case of password mismatches, log the passwords and used scheme so the
  11896. problem can be debugged. Enabling this also enables @samp{auth-debug}.
  11897. Defaults to @samp{#f}.
  11898. @end deftypevr
  11899. @deftypevr {@code{dovecot-configuration} parameter} boolean mail-debug?
  11900. Enable mail process debugging. This can help you figure out why Dovecot
  11901. isn't finding your mails. Defaults to @samp{#f}.
  11902. @end deftypevr
  11903. @deftypevr {@code{dovecot-configuration} parameter} boolean verbose-ssl?
  11904. Show protocol level SSL errors. Defaults to @samp{#f}.
  11905. @end deftypevr
  11906. @deftypevr {@code{dovecot-configuration} parameter} string log-timestamp
  11907. Prefix for each line written to log file. % codes are in strftime(3)
  11908. format. Defaults to @samp{"\"%b %d %H:%M:%S \""}.
  11909. @end deftypevr
  11910. @deftypevr {@code{dovecot-configuration} parameter} space-separated-string-list login-log-format-elements
  11911. List of elements we want to log. The elements which have a non-empty
  11912. variable value are joined together to form a comma-separated string.
  11913. @end deftypevr
  11914. @deftypevr {@code{dovecot-configuration} parameter} string login-log-format
  11915. Login log format. %s contains @samp{login-log-format-elements} string, %$
  11916. contains the data we want to log. Defaults to @samp{"%$: %s"}.
  11917. @end deftypevr
  11918. @deftypevr {@code{dovecot-configuration} parameter} string mail-log-prefix
  11919. Log prefix for mail processes. See doc/wiki/Variables.txt for list of
  11920. possible variables you can use. Defaults to
  11921. @samp{"\"%s(%u)<%@{pid@}><%@{session@}>: \""}.
  11922. @end deftypevr
  11923. @deftypevr {@code{dovecot-configuration} parameter} string deliver-log-format
  11924. Format to use for logging mail deliveries. You can use variables:
  11925. @table @code
  11926. @item %$
  11927. Delivery status message (e.g.@: @samp{saved to INBOX})
  11928. @item %m
  11929. Message-ID
  11930. @item %s
  11931. Subject
  11932. @item %f
  11933. From address
  11934. @item %p
  11935. Physical size
  11936. @item %w
  11937. Virtual size.
  11938. @end table
  11939. Defaults to @samp{"msgid=%m: %$"}.
  11940. @end deftypevr
  11941. @deftypevr {@code{dovecot-configuration} parameter} string mail-location
  11942. Location for users' mailboxes. The default is empty, which means that
  11943. Dovecot tries to find the mailboxes automatically. This won't work if the
  11944. user doesn't yet have any mail, so you should explicitly tell Dovecot the
  11945. full location.
  11946. If you're using mbox, giving a path to the INBOX file (e.g.@: /var/mail/%u)
  11947. isn't enough. You'll also need to tell Dovecot where the other mailboxes
  11948. are kept. This is called the "root mail directory", and it must be the
  11949. first path given in the @samp{mail-location} setting.
  11950. There are a few special variables you can use, eg.:
  11951. @table @samp
  11952. @item %u
  11953. username
  11954. @item %n
  11955. user part in user@@domain, same as %u if there's no domain
  11956. @item %d
  11957. domain part in user@@domain, empty if there's no domain
  11958. @item %h
  11959. home director
  11960. @end table
  11961. See doc/wiki/Variables.txt for full list. Some examples:
  11962. @table @samp
  11963. @item maildir:~/Maildir
  11964. @item mbox:~/mail:INBOX=/var/mail/%u
  11965. @item mbox:/var/mail/%d/%1n/%n:INDEX=/var/indexes/%d/%1n/%
  11966. @end table
  11967. Defaults to @samp{""}.
  11968. @end deftypevr
  11969. @deftypevr {@code{dovecot-configuration} parameter} string mail-uid
  11970. System user and group used to access mails. If you use multiple, userdb can
  11971. override these by returning uid or gid fields. You can use either numbers
  11972. or names. <doc/wiki/UserIds.txt>. Defaults to @samp{""}.
  11973. @end deftypevr
  11974. @deftypevr {@code{dovecot-configuration} parameter} string mail-gid
  11975. Defaults to @samp{""}.
  11976. @end deftypevr
  11977. @deftypevr {@code{dovecot-configuration} parameter} string mail-privileged-group
  11978. Group to enable temporarily for privileged operations. Currently this is
  11979. used only with INBOX when either its initial creation or dotlocking fails.
  11980. Typically this is set to "mail" to give access to /var/mail. Defaults to
  11981. @samp{""}.
  11982. @end deftypevr
  11983. @deftypevr {@code{dovecot-configuration} parameter} string mail-access-groups
  11984. Grant access to these supplementary groups for mail processes. Typically
  11985. these are used to set up access to shared mailboxes. Note that it may be
  11986. dangerous to set these if users can create symlinks (e.g.@: if "mail" group
  11987. is set here, ln -s /var/mail ~/mail/var could allow a user to delete others'
  11988. mailboxes, or ln -s /secret/shared/box ~/mail/mybox would allow reading
  11989. it). Defaults to @samp{""}.
  11990. @end deftypevr
  11991. @deftypevr {@code{dovecot-configuration} parameter} boolean mail-full-filesystem-access?
  11992. Allow full file system access to clients. There's no access checks other
  11993. than what the operating system does for the active UID/GID. It works with
  11994. both maildir and mboxes, allowing you to prefix mailboxes names with e.g.@:
  11995. /path/ or ~user/. Defaults to @samp{#f}.
  11996. @end deftypevr
  11997. @deftypevr {@code{dovecot-configuration} parameter} boolean mmap-disable?
  11998. Don't use mmap() at all. This is required if you store indexes to shared
  11999. file systems (NFS or clustered file system). Defaults to @samp{#f}.
  12000. @end deftypevr
  12001. @deftypevr {@code{dovecot-configuration} parameter} boolean dotlock-use-excl?
  12002. Rely on @samp{O_EXCL} to work when creating dotlock files. NFS supports
  12003. @samp{O_EXCL} since version 3, so this should be safe to use nowadays by
  12004. default. Defaults to @samp{#t}.
  12005. @end deftypevr
  12006. @deftypevr {@code{dovecot-configuration} parameter} string mail-fsync
  12007. When to use fsync() or fdatasync() calls:
  12008. @table @code
  12009. @item optimized
  12010. Whenever necessary to avoid losing important data
  12011. @item always
  12012. Useful with e.g.@: NFS when write()s are delayed
  12013. @item never
  12014. Never use it (best performance, but crashes can lose data).
  12015. @end table
  12016. Defaults to @samp{"optimized"}.
  12017. @end deftypevr
  12018. @deftypevr {@code{dovecot-configuration} parameter} boolean mail-nfs-storage?
  12019. Mail storage exists in NFS. Set this to yes to make Dovecot flush NFS
  12020. caches whenever needed. If you're using only a single mail server this
  12021. isn't needed. Defaults to @samp{#f}.
  12022. @end deftypevr
  12023. @deftypevr {@code{dovecot-configuration} parameter} boolean mail-nfs-index?
  12024. Mail index files also exist in NFS. Setting this to yes requires
  12025. @samp{mmap-disable? #t} and @samp{fsync-disable? #f}. Defaults to
  12026. @samp{#f}.
  12027. @end deftypevr
  12028. @deftypevr {@code{dovecot-configuration} parameter} string lock-method
  12029. Locking method for index files. Alternatives are fcntl, flock and dotlock.
  12030. Dotlocking uses some tricks which may create more disk I/O than other
  12031. locking methods. NFS users: flock doesn't work, remember to change
  12032. @samp{mmap-disable}. Defaults to @samp{"fcntl"}.
  12033. @end deftypevr
  12034. @deftypevr {@code{dovecot-configuration} parameter} file-name mail-temp-dir
  12035. Directory in which LDA/LMTP temporarily stores incoming mails >128 kB.
  12036. Defaults to @samp{"/tmp"}.
  12037. @end deftypevr
  12038. @deftypevr {@code{dovecot-configuration} parameter} non-negative-integer first-valid-uid
  12039. Valid UID range for users. This is mostly to make sure that users can't log
  12040. in as daemons or other system users. Note that denying root logins is
  12041. hardcoded to dovecot binary and can't be done even if @samp{first-valid-uid}
  12042. is set to 0. Defaults to @samp{500}.
  12043. @end deftypevr
  12044. @deftypevr {@code{dovecot-configuration} parameter} non-negative-integer last-valid-uid
  12045. Defaults to @samp{0}.
  12046. @end deftypevr
  12047. @deftypevr {@code{dovecot-configuration} parameter} non-negative-integer first-valid-gid
  12048. Valid GID range for users. Users having non-valid GID as primary group ID
  12049. aren't allowed to log in. If user belongs to supplementary groups with
  12050. non-valid GIDs, those groups are not set. Defaults to @samp{1}.
  12051. @end deftypevr
  12052. @deftypevr {@code{dovecot-configuration} parameter} non-negative-integer last-valid-gid
  12053. Defaults to @samp{0}.
  12054. @end deftypevr
  12055. @deftypevr {@code{dovecot-configuration} parameter} non-negative-integer mail-max-keyword-length
  12056. Maximum allowed length for mail keyword name. It's only forced when trying
  12057. to create new keywords. Defaults to @samp{50}.
  12058. @end deftypevr
  12059. @deftypevr {@code{dovecot-configuration} parameter} colon-separated-file-name-list valid-chroot-dirs
  12060. List of directories under which chrooting is allowed for mail processes
  12061. (i.e.@: /var/mail will allow chrooting to /var/mail/foo/bar too). This
  12062. setting doesn't affect @samp{login-chroot} @samp{mail-chroot} or auth chroot
  12063. settings. If this setting is empty, "/./" in home dirs are ignored.
  12064. WARNING: Never add directories here which local users can modify, that may
  12065. lead to root exploit. Usually this should be done only if you don't allow
  12066. shell access for users. <doc/wiki/Chrooting.txt>. Defaults to @samp{()}.
  12067. @end deftypevr
  12068. @deftypevr {@code{dovecot-configuration} parameter} string mail-chroot
  12069. Default chroot directory for mail processes. This can be overridden for
  12070. specific users in user database by giving /./ in user's home directory
  12071. (e.g.@: /home/./user chroots into /home). Note that usually there is no
  12072. real need to do chrooting, Dovecot doesn't allow users to access files
  12073. outside their mail directory anyway. If your home directories are prefixed
  12074. with the chroot directory, append "/."@: to @samp{mail-chroot}.
  12075. <doc/wiki/Chrooting.txt>. Defaults to @samp{""}.
  12076. @end deftypevr
  12077. @deftypevr {@code{dovecot-configuration} parameter} file-name auth-socket-path
  12078. UNIX socket path to master authentication server to find users. This is
  12079. used by imap (for shared users) and lda. Defaults to
  12080. @samp{"/var/run/dovecot/auth-userdb"}.
  12081. @end deftypevr
  12082. @deftypevr {@code{dovecot-configuration} parameter} file-name mail-plugin-dir
  12083. Directory where to look up mail plugins. Defaults to
  12084. @samp{"/usr/lib/dovecot"}.
  12085. @end deftypevr
  12086. @deftypevr {@code{dovecot-configuration} parameter} space-separated-string-list mail-plugins
  12087. List of plugins to load for all services. Plugins specific to IMAP, LDA,
  12088. etc.@: are added to this list in their own .conf files. Defaults to
  12089. @samp{()}.
  12090. @end deftypevr
  12091. @deftypevr {@code{dovecot-configuration} parameter} non-negative-integer mail-cache-min-mail-count
  12092. The minimum number of mails in a mailbox before updates are done to cache
  12093. file. This allows optimizing Dovecot's behavior to do less disk writes at
  12094. the cost of more disk reads. Defaults to @samp{0}.
  12095. @end deftypevr
  12096. @deftypevr {@code{dovecot-configuration} parameter} string mailbox-idle-check-interval
  12097. When IDLE command is running, mailbox is checked once in a while to see if
  12098. there are any new mails or other changes. This setting defines the minimum
  12099. time to wait between those checks. Dovecot can also use dnotify, inotify
  12100. and kqueue to find out immediately when changes occur. Defaults to
  12101. @samp{"30 secs"}.
  12102. @end deftypevr
  12103. @deftypevr {@code{dovecot-configuration} parameter} boolean mail-save-crlf?
  12104. Save mails with CR+LF instead of plain LF. This makes sending those mails
  12105. take less CPU, especially with sendfile() syscall with Linux and FreeBSD.
  12106. But it also creates a bit more disk I/O which may just make it slower. Also
  12107. note that if other software reads the mboxes/maildirs, they may handle the
  12108. extra CRs wrong and cause problems. Defaults to @samp{#f}.
  12109. @end deftypevr
  12110. @deftypevr {@code{dovecot-configuration} parameter} boolean maildir-stat-dirs?
  12111. By default LIST command returns all entries in maildir beginning with a
  12112. dot. Enabling this option makes Dovecot return only entries which are
  12113. directories. This is done by stat()ing each entry, so it causes more disk
  12114. I/O. (For systems setting struct @samp{dirent->d_type} this check is free
  12115. and it's done always regardless of this setting). Defaults to @samp{#f}.
  12116. @end deftypevr
  12117. @deftypevr {@code{dovecot-configuration} parameter} boolean maildir-copy-with-hardlinks?
  12118. When copying a message, do it with hard links whenever possible. This makes
  12119. the performance much better, and it's unlikely to have any side effects.
  12120. Defaults to @samp{#t}.
  12121. @end deftypevr
  12122. @deftypevr {@code{dovecot-configuration} parameter} boolean maildir-very-dirty-syncs?
  12123. Assume Dovecot is the only MUA accessing Maildir: Scan cur/ directory only
  12124. when its mtime changes unexpectedly or when we can't find the mail
  12125. otherwise. Defaults to @samp{#f}.
  12126. @end deftypevr
  12127. @deftypevr {@code{dovecot-configuration} parameter} space-separated-string-list mbox-read-locks
  12128. Which locking methods to use for locking mbox. There are four available:
  12129. @table @code
  12130. @item dotlock
  12131. Create <mailbox>.lock file. This is the oldest and most NFS-safe solution.
  12132. If you want to use /var/mail/ like directory, the users will need write
  12133. access to that directory.
  12134. @item dotlock-try
  12135. Same as dotlock, but if it fails because of permissions or because there
  12136. isn't enough disk space, just skip it.
  12137. @item fcntl
  12138. Use this if possible. Works with NFS too if lockd is used.
  12139. @item flock
  12140. May not exist in all systems. Doesn't work with NFS.
  12141. @item lockf
  12142. May not exist in all systems. Doesn't work with NFS.
  12143. @end table
  12144. You can use multiple locking methods; if you do the order they're declared
  12145. in is important to avoid deadlocks if other MTAs/MUAs are using multiple
  12146. locking methods as well. Some operating systems don't allow using some of
  12147. them simultaneously.
  12148. @end deftypevr
  12149. @deftypevr {@code{dovecot-configuration} parameter} space-separated-string-list mbox-write-locks
  12150. @end deftypevr
  12151. @deftypevr {@code{dovecot-configuration} parameter} string mbox-lock-timeout
  12152. Maximum time to wait for lock (all of them) before aborting. Defaults to
  12153. @samp{"5 mins"}.
  12154. @end deftypevr
  12155. @deftypevr {@code{dovecot-configuration} parameter} string mbox-dotlock-change-timeout
  12156. If dotlock exists but the mailbox isn't modified in any way, override the
  12157. lock file after this much time. Defaults to @samp{"2 mins"}.
  12158. @end deftypevr
  12159. @deftypevr {@code{dovecot-configuration} parameter} boolean mbox-dirty-syncs?
  12160. When mbox changes unexpectedly we have to fully read it to find out what
  12161. changed. If the mbox is large this can take a long time. Since the change
  12162. is usually just a newly appended mail, it'd be faster to simply read the new
  12163. mails. If this setting is enabled, Dovecot does this but still safely
  12164. fallbacks to re-reading the whole mbox file whenever something in mbox isn't
  12165. how it's expected to be. The only real downside to this setting is that if
  12166. some other MUA changes message flags, Dovecot doesn't notice it
  12167. immediately. Note that a full sync is done with SELECT, EXAMINE, EXPUNGE
  12168. and CHECK commands. Defaults to @samp{#t}.
  12169. @end deftypevr
  12170. @deftypevr {@code{dovecot-configuration} parameter} boolean mbox-very-dirty-syncs?
  12171. Like @samp{mbox-dirty-syncs}, but don't do full syncs even with SELECT,
  12172. EXAMINE, EXPUNGE or CHECK commands. If this is set, @samp{mbox-dirty-syncs}
  12173. is ignored. Defaults to @samp{#f}.
  12174. @end deftypevr
  12175. @deftypevr {@code{dovecot-configuration} parameter} boolean mbox-lazy-writes?
  12176. Delay writing mbox headers until doing a full write sync (EXPUNGE and CHECK
  12177. commands and when closing the mailbox). This is especially useful for POP3
  12178. where clients often delete all mails. The downside is that our changes
  12179. aren't immediately visible to other MUAs. Defaults to @samp{#t}.
  12180. @end deftypevr
  12181. @deftypevr {@code{dovecot-configuration} parameter} non-negative-integer mbox-min-index-size
  12182. If mbox size is smaller than this (e.g.@: 100k), don't write index files.
  12183. If an index file already exists it's still read, just not updated. Defaults
  12184. to @samp{0}.
  12185. @end deftypevr
  12186. @deftypevr {@code{dovecot-configuration} parameter} non-negative-integer mdbox-rotate-size
  12187. Maximum dbox file size until it's rotated. Defaults to @samp{10000000}.
  12188. @end deftypevr
  12189. @deftypevr {@code{dovecot-configuration} parameter} string mdbox-rotate-interval
  12190. Maximum dbox file age until it's rotated. Typically in days. Day begins
  12191. from midnight, so 1d = today, 2d = yesterday, etc. 0 = check disabled.
  12192. Defaults to @samp{"1d"}.
  12193. @end deftypevr
  12194. @deftypevr {@code{dovecot-configuration} parameter} boolean mdbox-preallocate-space?
  12195. When creating new mdbox files, immediately preallocate their size to
  12196. @samp{mdbox-rotate-size}. This setting currently works only in Linux with
  12197. some file systems (ext4, xfs). Defaults to @samp{#f}.
  12198. @end deftypevr
  12199. @deftypevr {@code{dovecot-configuration} parameter} string mail-attachment-dir
  12200. sdbox and mdbox support saving mail attachments to external files, which
  12201. also allows single instance storage for them. Other backends don't support
  12202. this for now.
  12203. WARNING: This feature hasn't been tested much yet. Use at your own risk.
  12204. Directory root where to store mail attachments. Disabled, if empty.
  12205. Defaults to @samp{""}.
  12206. @end deftypevr
  12207. @deftypevr {@code{dovecot-configuration} parameter} non-negative-integer mail-attachment-min-size
  12208. Attachments smaller than this aren't saved externally. It's also possible
  12209. to write a plugin to disable saving specific attachments externally.
  12210. Defaults to @samp{128000}.
  12211. @end deftypevr
  12212. @deftypevr {@code{dovecot-configuration} parameter} string mail-attachment-fs
  12213. File system backend to use for saving attachments:
  12214. @table @code
  12215. @item posix
  12216. No SiS done by Dovecot (but this might help FS's own deduplication)
  12217. @item sis posix
  12218. SiS with immediate byte-by-byte comparison during saving
  12219. @item sis-queue posix
  12220. SiS with delayed comparison and deduplication.
  12221. @end table
  12222. Defaults to @samp{"sis posix"}.
  12223. @end deftypevr
  12224. @deftypevr {@code{dovecot-configuration} parameter} string mail-attachment-hash
  12225. Hash format to use in attachment filenames. You can add any text and
  12226. variables: @code{%@{md4@}}, @code{%@{md5@}}, @code{%@{sha1@}},
  12227. @code{%@{sha256@}}, @code{%@{sha512@}}, @code{%@{size@}}. Variables can be
  12228. truncated, e.g.@: @code{%@{sha256:80@}} returns only first 80 bits.
  12229. Defaults to @samp{"%@{sha1@}"}.
  12230. @end deftypevr
  12231. @deftypevr {@code{dovecot-configuration} parameter} non-negative-integer default-process-limit
  12232. Defaults to @samp{100}.
  12233. @end deftypevr
  12234. @deftypevr {@code{dovecot-configuration} parameter} non-negative-integer default-client-limit
  12235. Defaults to @samp{1000}.
  12236. @end deftypevr
  12237. @deftypevr {@code{dovecot-configuration} parameter} non-negative-integer default-vsz-limit
  12238. Default VSZ (virtual memory size) limit for service processes. This is
  12239. mainly intended to catch and kill processes that leak memory before they eat
  12240. up everything. Defaults to @samp{256000000}.
  12241. @end deftypevr
  12242. @deftypevr {@code{dovecot-configuration} parameter} string default-login-user
  12243. Login user is internally used by login processes. This is the most
  12244. untrusted user in Dovecot system. It shouldn't have access to anything at
  12245. all. Defaults to @samp{"dovenull"}.
  12246. @end deftypevr
  12247. @deftypevr {@code{dovecot-configuration} parameter} string default-internal-user
  12248. Internal user is used by unprivileged processes. It should be separate from
  12249. login user, so that login processes can't disturb other processes. Defaults
  12250. to @samp{"dovecot"}.
  12251. @end deftypevr
  12252. @deftypevr {@code{dovecot-configuration} parameter} string ssl?
  12253. SSL/TLS support: yes, no, required. <doc/wiki/SSL.txt>. Defaults to
  12254. @samp{"required"}.
  12255. @end deftypevr
  12256. @deftypevr {@code{dovecot-configuration} parameter} string ssl-cert
  12257. PEM encoded X.509 SSL/TLS certificate (public key). Defaults to
  12258. @samp{"</etc/dovecot/default.pem"}.
  12259. @end deftypevr
  12260. @deftypevr {@code{dovecot-configuration} parameter} string ssl-key
  12261. PEM encoded SSL/TLS private key. The key is opened before dropping root
  12262. privileges, so keep the key file unreadable by anyone but root. Defaults to
  12263. @samp{"</etc/dovecot/private/default.pem"}.
  12264. @end deftypevr
  12265. @deftypevr {@code{dovecot-configuration} parameter} string ssl-key-password
  12266. If key file is password protected, give the password here. Alternatively
  12267. give it when starting dovecot with -p parameter. Since this file is often
  12268. world-readable, you may want to place this setting instead to a different.
  12269. Defaults to @samp{""}.
  12270. @end deftypevr
  12271. @deftypevr {@code{dovecot-configuration} parameter} string ssl-ca
  12272. PEM encoded trusted certificate authority. Set this only if you intend to
  12273. use @samp{ssl-verify-client-cert? #t}. The file should contain the CA
  12274. certificate(s) followed by the matching CRL(s). (e.g.@: @samp{ssl-ca
  12275. </etc/ssl/certs/ca.pem}). Defaults to @samp{""}.
  12276. @end deftypevr
  12277. @deftypevr {@code{dovecot-configuration} parameter} boolean ssl-require-crl?
  12278. Require that CRL check succeeds for client certificates. Defaults to
  12279. @samp{#t}.
  12280. @end deftypevr
  12281. @deftypevr {@code{dovecot-configuration} parameter} boolean ssl-verify-client-cert?
  12282. Request client to send a certificate. If you also want to require it, set
  12283. @samp{auth-ssl-require-client-cert? #t} in auth section. Defaults to
  12284. @samp{#f}.
  12285. @end deftypevr
  12286. @deftypevr {@code{dovecot-configuration} parameter} string ssl-cert-username-field
  12287. Which field from certificate to use for username. commonName and
  12288. x500UniqueIdentifier are the usual choices. You'll also need to set
  12289. @samp{auth-ssl-username-from-cert? #t}. Defaults to @samp{"commonName"}.
  12290. @end deftypevr
  12291. @deftypevr {@code{dovecot-configuration} parameter} string ssl-min-protocol
  12292. Minimum SSL protocol version to accept. Defaults to @samp{"TLSv1"}.
  12293. @end deftypevr
  12294. @deftypevr {@code{dovecot-configuration} parameter} string ssl-cipher-list
  12295. SSL ciphers to use. Defaults to
  12296. @samp{"ALL:!kRSA:!SRP:!kDHd:!DSS:!aNULL:!eNULL:!EXPORT:!DES:!3DES:!MD5:!PSK:!RC4:!ADH:!LOW@@STRENGTH"}.
  12297. @end deftypevr
  12298. @deftypevr {@code{dovecot-configuration} parameter} string ssl-crypto-device
  12299. SSL crypto device to use, for valid values run "openssl engine". Defaults
  12300. to @samp{""}.
  12301. @end deftypevr
  12302. @deftypevr {@code{dovecot-configuration} parameter} string postmaster-address
  12303. Address to use when sending rejection mails. %d expands to recipient
  12304. domain. Defaults to @samp{"postmaster@@%d"}.
  12305. @end deftypevr
  12306. @deftypevr {@code{dovecot-configuration} parameter} string hostname
  12307. Hostname to use in various parts of sent mails (e.g.@: in Message-Id) and
  12308. in LMTP replies. Default is the system's real hostname@@domain. Defaults
  12309. to @samp{""}.
  12310. @end deftypevr
  12311. @deftypevr {@code{dovecot-configuration} parameter} boolean quota-full-tempfail?
  12312. If user is over quota, return with temporary failure instead of bouncing the
  12313. mail. Defaults to @samp{#f}.
  12314. @end deftypevr
  12315. @deftypevr {@code{dovecot-configuration} parameter} file-name sendmail-path
  12316. Binary to use for sending mails. Defaults to @samp{"/usr/sbin/sendmail"}.
  12317. @end deftypevr
  12318. @deftypevr {@code{dovecot-configuration} parameter} string submission-host
  12319. If non-empty, send mails via this SMTP host[:port] instead of sendmail.
  12320. Defaults to @samp{""}.
  12321. @end deftypevr
  12322. @deftypevr {@code{dovecot-configuration} parameter} string rejection-subject
  12323. Subject: header to use for rejection mails. You can use the same variables
  12324. as for @samp{rejection-reason} below. Defaults to @samp{"Rejected: %s"}.
  12325. @end deftypevr
  12326. @deftypevr {@code{dovecot-configuration} parameter} string rejection-reason
  12327. Human readable error message for rejection mails. You can use variables:
  12328. @table @code
  12329. @item %n
  12330. CRLF
  12331. @item %r
  12332. reason
  12333. @item %s
  12334. original subject
  12335. @item %t
  12336. recipient
  12337. @end table
  12338. Defaults to @samp{"Your message to <%t> was automatically rejected:%n%r"}.
  12339. @end deftypevr
  12340. @deftypevr {@code{dovecot-configuration} parameter} string recipient-delimiter
  12341. Delimiter character between local-part and detail in email address.
  12342. Defaults to @samp{"+"}.
  12343. @end deftypevr
  12344. @deftypevr {@code{dovecot-configuration} parameter} string lda-original-recipient-header
  12345. Header where the original recipient address (SMTP's RCPT TO: address) is
  12346. taken from if not available elsewhere. With dovecot-lda -a parameter
  12347. overrides this. A commonly used header for this is X-Original-To. Defaults
  12348. to @samp{""}.
  12349. @end deftypevr
  12350. @deftypevr {@code{dovecot-configuration} parameter} boolean lda-mailbox-autocreate?
  12351. Should saving a mail to a nonexistent mailbox automatically create it?.
  12352. Defaults to @samp{#f}.
  12353. @end deftypevr
  12354. @deftypevr {@code{dovecot-configuration} parameter} boolean lda-mailbox-autosubscribe?
  12355. Should automatically created mailboxes be also automatically subscribed?.
  12356. Defaults to @samp{#f}.
  12357. @end deftypevr
  12358. @deftypevr {@code{dovecot-configuration} parameter} non-negative-integer imap-max-line-length
  12359. Maximum IMAP command line length. Some clients generate very long command
  12360. lines with huge mailboxes, so you may need to raise this if you get "Too
  12361. long argument" or "IMAP command line too large" errors often. Defaults to
  12362. @samp{64000}.
  12363. @end deftypevr
  12364. @deftypevr {@code{dovecot-configuration} parameter} string imap-logout-format
  12365. IMAP logout format string:
  12366. @table @code
  12367. @item %i
  12368. total number of bytes read from client
  12369. @item %o
  12370. total number of bytes sent to client.
  12371. @end table
  12372. See @file{doc/wiki/Variables.txt} for a list of all the variables you can
  12373. use. Defaults to @samp{"in=%i out=%o deleted=%@{deleted@}
  12374. expunged=%@{expunged@} trashed=%@{trashed@} hdr_count=%@{fetch_hdr_count@}
  12375. hdr_bytes=%@{fetch_hdr_bytes@} body_count=%@{fetch_body_count@}
  12376. body_bytes=%@{fetch_body_bytes@}"}.
  12377. @end deftypevr
  12378. @deftypevr {@code{dovecot-configuration} parameter} string imap-capability
  12379. Override the IMAP CAPABILITY response. If the value begins with '+', add
  12380. the given capabilities on top of the defaults (e.g.@: +XFOO XBAR). Defaults
  12381. to @samp{""}.
  12382. @end deftypevr
  12383. @deftypevr {@code{dovecot-configuration} parameter} string imap-idle-notify-interval
  12384. How long to wait between "OK Still here" notifications when client is
  12385. IDLEing. Defaults to @samp{"2 mins"}.
  12386. @end deftypevr
  12387. @deftypevr {@code{dovecot-configuration} parameter} string imap-id-send
  12388. ID field names and values to send to clients. Using * as the value makes
  12389. Dovecot use the default value. The following fields have default values
  12390. currently: name, version, os, os-version, support-url, support-email.
  12391. Defaults to @samp{""}.
  12392. @end deftypevr
  12393. @deftypevr {@code{dovecot-configuration} parameter} string imap-id-log
  12394. ID fields sent by client to log. * means everything. Defaults to
  12395. @samp{""}.
  12396. @end deftypevr
  12397. @deftypevr {@code{dovecot-configuration} parameter} space-separated-string-list imap-client-workarounds
  12398. Workarounds for various client bugs:
  12399. @table @code
  12400. @item delay-newmail
  12401. Send EXISTS/RECENT new mail notifications only when replying to NOOP and
  12402. CHECK commands. Some clients ignore them otherwise, for example OSX Mail
  12403. (<v2.1). Outlook Express breaks more badly though, without this it may show
  12404. user "Message no longer in server" errors. Note that OE6 still breaks even
  12405. with this workaround if synchronization is set to "Headers Only".
  12406. @item tb-extra-mailbox-sep
  12407. Thunderbird gets somehow confused with LAYOUT=fs (mbox and dbox) and adds
  12408. extra @samp{/} suffixes to mailbox names. This option causes Dovecot to
  12409. ignore the extra @samp{/} instead of treating it as invalid mailbox name.
  12410. @item tb-lsub-flags
  12411. Show \Noselect flags for LSUB replies with LAYOUT=fs (e.g.@: mbox). This
  12412. makes Thunderbird realize they aren't selectable and show them greyed out,
  12413. instead of only later giving "not selectable" popup error.
  12414. @end table
  12415. Defaults to @samp{()}.
  12416. @end deftypevr
  12417. @deftypevr {@code{dovecot-configuration} parameter} string imap-urlauth-host
  12418. Host allowed in URLAUTH URLs sent by client. "*" allows all. Defaults to
  12419. @samp{""}.
  12420. @end deftypevr
  12421. Whew! Lots of configuration options. The nice thing about it though is that
  12422. GuixSD has a complete interface to Dovecot's configuration language. This
  12423. allows not only a nice way to declare configurations, but also offers
  12424. reflective capabilities as well: users can write code to inspect and
  12425. transform configurations from within Scheme.
  12426. However, it could be that you just want to get a @code{dovecot.conf} up and
  12427. running. In that case, you can pass an @code{opaque-dovecot-configuration}
  12428. as the @code{#:config} parameter to @code{dovecot-service}. As its name
  12429. indicates, an opaque configuration does not have easy reflective
  12430. capabilities.
  12431. Available @code{opaque-dovecot-configuration} fields are:
  12432. @deftypevr {@code{opaque-dovecot-configuration} parameter} package dovecot
  12433. The dovecot package.
  12434. @end deftypevr
  12435. @deftypevr {@code{opaque-dovecot-configuration} parameter} string string
  12436. The contents of the @code{dovecot.conf}, as a string.
  12437. @end deftypevr
  12438. For example, if your @code{dovecot.conf} is just the empty string, you could
  12439. instantiate a dovecot service like this:
  12440. @example
  12441. (dovecot-service #:config
  12442. (opaque-dovecot-configuration
  12443. (string "")))
  12444. @end example
  12445. @subsubheading OpenSMTPD Service
  12446. @deffn {Scheme Variable} opensmtpd-service-type
  12447. This is the type of the @uref{https://www.opensmtpd.org, OpenSMTPD} service,
  12448. whose value should be an @code{opensmtpd-configuration} object as in this
  12449. example:
  12450. @example
  12451. (service opensmtpd-service-type
  12452. (opensmtpd-configuration
  12453. (config-file (local-file "./my-smtpd.conf"))))
  12454. @end example
  12455. @end deffn
  12456. @deftp {Data Type} opensmtpd-configuration
  12457. Data type representing the configuration of opensmtpd.
  12458. @table @asis
  12459. @item @code{package} (default: @var{opensmtpd})
  12460. Package object of the OpenSMTPD SMTP server.
  12461. @item @code{config-file} (default: @var{%default-opensmtpd-file})
  12462. File-like object of the OpenSMTPD configuration file to use. By default it
  12463. listens on the loopback network interface, and allows for mail from users
  12464. and daemons on the local machine, as well as permitting email to remote
  12465. servers. Run @command{man smtpd.conf} for more information.
  12466. @end table
  12467. @end deftp
  12468. @subsubheading Exim Service
  12469. @cindex mail transfer agent (MTA)
  12470. @cindex MTA (mail transfer agent)
  12471. @cindex SMTP
  12472. @deffn {Scheme Variable} exim-service-type
  12473. This is the type of the @uref{https://exim.org, Exim} mail transfer agent
  12474. (MTA), whose value should be an @code{exim-configuration} object as in this
  12475. example:
  12476. @example
  12477. (service exim-service-type
  12478. (exim-configuration
  12479. (config-file (local-file "./my-exim.conf"))))
  12480. @end example
  12481. @end deffn
  12482. In order to use an @code{exim-service-type} service you must also have a
  12483. @code{mail-aliases-service-type} service present in your
  12484. @code{operating-system} (even if it has no aliases).
  12485. @deftp {Data Type} exim-configuration
  12486. Data type representing the configuration of exim.
  12487. @table @asis
  12488. @item @code{package} (default: @var{exim})
  12489. Package object of the Exim server.
  12490. @item @code{config-file} (default: @code{#f})
  12491. File-like object of the Exim configuration file to use. If its value is
  12492. @code{#f} then use the default configuration file from the package provided
  12493. in @code{package}. The resulting configuration file is loaded after setting
  12494. the @code{exim_user} and @code{exim_group} configuration variables.
  12495. @end table
  12496. @end deftp
  12497. @subsubheading Mail Aliases Service
  12498. @cindex email aliases
  12499. @cindex aliases, for email addresses
  12500. @deffn {Scheme Variable} mail-aliases-service-type
  12501. This is the type of the service which provides @code{/etc/aliases},
  12502. specifying how to deliver mail to users on this system.
  12503. @example
  12504. (service mail-aliases-service-type
  12505. '(("postmaster" "bob")
  12506. ("bob" "bob@@example.com" "bob@@example2.com")))
  12507. @end example
  12508. @end deffn
  12509. The configuration for a @code{mail-aliases-service-type} service is an
  12510. association list denoting how to deliver mail that comes to this
  12511. system. Each entry is of the form @code{(alias addresses ...)}, with
  12512. @code{alias} specifying the local alias and @code{addresses} specifying
  12513. where to deliver this user's mail.
  12514. The aliases aren't required to exist as users on the local system. In the
  12515. above example, there doesn't need to be a @code{postmaster} entry in the
  12516. @code{operating-system}'s @code{user-accounts} in order to deliver the
  12517. @code{postmaster} mail to @code{bob} (which subsequently would deliver mail
  12518. to @code{bob@@example.com} and @code{bob@@example2.com}).
  12519. @node Kurznachrichtendienste
  12520. @subsubsection Kurznachrichtendienste
  12521. @cindex messaging
  12522. @cindex jabber
  12523. @cindex XMPP
  12524. The @code{(gnu services messaging)} module provides Guix service definitions
  12525. for messaging services: currently only Prosody is supported.
  12526. @subsubheading Prosody Service
  12527. @deffn {Scheme Variable} prosody-service-type
  12528. This is the type for the @uref{https://prosody.im, Prosody XMPP
  12529. communication server}. Its value must be a @code{prosody-configuration}
  12530. record as in this example:
  12531. @example
  12532. (service prosody-service-type
  12533. (prosody-configuration
  12534. (modules-enabled (cons "groups" "mam" %default-modules-enabled))
  12535. (int-components
  12536. (list
  12537. (int-component-configuration
  12538. (hostname "conference.example.net")
  12539. (plugin "muc")
  12540. (mod-muc (mod-muc-configuration)))))
  12541. (virtualhosts
  12542. (list
  12543. (virtualhost-configuration
  12544. (domain "example.net"))))))
  12545. @end example
  12546. See below for details about @code{prosody-configuration}.
  12547. @end deffn
  12548. By default, Prosody does not need much configuration. Only one
  12549. @code{virtualhosts} field is needed: it specifies the domain you wish
  12550. Prosody to serve.
  12551. You can perform various sanity checks on the generated configuration with
  12552. the @code{prosodyctl check} command.
  12553. Prosodyctl will also help you to import certificates from the
  12554. @code{letsencrypt} directory so that the @code{prosody} user can access
  12555. them. See @url{https://prosody.im/doc/letsencrypt}.
  12556. @example
  12557. prosodyctl --root cert import /etc/letsencrypt/live
  12558. @end example
  12559. The available configuration parameters follow. Each parameter definition is
  12560. preceded by its type; for example, @samp{string-list foo} indicates that the
  12561. @code{foo} parameter should be specified as a list of strings. Types
  12562. starting with @code{maybe-} denote parameters that won't show up in
  12563. @code{prosody.cfg.lua} when their value is @code{'disabled}.
  12564. There is also a way to specify the configuration as a string, if you have an
  12565. old @code{prosody.cfg.lua} file that you want to port over from some other
  12566. system; see the end for more details.
  12567. The @code{file-object} type designates either a file-like object
  12568. (@pxref{G-Ausdrücke, file-like objects}) or a file name.
  12569. @c The following documentation was initially generated by
  12570. @c (generate-documentation) in (gnu services messaging). Manually maintained
  12571. @c documentation is better, so we shouldn't hesitate to edit below as
  12572. @c needed. However if the change you want to make to this documentation
  12573. @c can be done in an automated way, it's probably easier to change
  12574. @c (generate-documentation) than to make it below and have to deal with
  12575. @c the churn as Prosody updates.
  12576. Available @code{prosody-configuration} fields are:
  12577. @deftypevr {@code{prosody-configuration} parameter} package prosody
  12578. The Prosody package.
  12579. @end deftypevr
  12580. @deftypevr {@code{prosody-configuration} parameter} file-name data-path
  12581. Location of the Prosody data storage directory. See
  12582. @url{https://prosody.im/doc/configure}. Defaults to
  12583. @samp{"/var/lib/prosody"}.
  12584. @end deftypevr
  12585. @deftypevr {@code{prosody-configuration} parameter} file-object-list plugin-paths
  12586. Additional plugin directories. They are searched in all the specified paths
  12587. in order. See @url{https://prosody.im/doc/plugins_directory}. Defaults to
  12588. @samp{()}.
  12589. @end deftypevr
  12590. @deftypevr {@code{prosody-configuration} parameter} file-name certificates
  12591. Every virtual host and component needs a certificate so that clients and
  12592. servers can securely verify its identity. Prosody will automatically load
  12593. certificates/keys from the directory specified here. Defaults to
  12594. @samp{"/etc/prosody/certs"}.
  12595. @end deftypevr
  12596. @deftypevr {@code{prosody-configuration} parameter} string-list admins
  12597. This is a list of accounts that are admins for the server. Note that you
  12598. must create the accounts separately. See
  12599. @url{https://prosody.im/doc/admins} and
  12600. @url{https://prosody.im/doc/creating_accounts}. Example: @code{(admins
  12601. '("user1@@example.com" "user2@@example.net"))} Defaults to @samp{()}.
  12602. @end deftypevr
  12603. @deftypevr {@code{prosody-configuration} parameter} boolean use-libevent?
  12604. Enable use of libevent for better performance under high load. See
  12605. @url{https://prosody.im/doc/libevent}. Defaults to @samp{#f}.
  12606. @end deftypevr
  12607. @deftypevr {@code{prosody-configuration} parameter} module-list modules-enabled
  12608. This is the list of modules Prosody will load on startup. It looks for
  12609. @code{mod_modulename.lua} in the plugins folder, so make sure that exists
  12610. too. Documentation on modules can be found at:
  12611. @url{https://prosody.im/doc/modules}. Defaults to @samp{("roster"
  12612. "saslauth" "tls" "dialback" "disco" "carbons" "private" "blocklist" "vcard"
  12613. "version" "uptime" "time" "ping" "pep" "register" "admin_adhoc")}.
  12614. @end deftypevr
  12615. @deftypevr {@code{prosody-configuration} parameter} string-list modules-disabled
  12616. @samp{"offline"}, @samp{"c2s"} and @samp{"s2s"} are auto-loaded, but should
  12617. you want to disable them then add them to this list. Defaults to @samp{()}.
  12618. @end deftypevr
  12619. @deftypevr {@code{prosody-configuration} parameter} file-object groups-file
  12620. Path to a text file where the shared groups are defined. If this path is
  12621. empty then @samp{mod_groups} does nothing. See
  12622. @url{https://prosody.im/doc/modules/mod_groups}. Defaults to
  12623. @samp{"/var/lib/prosody/sharedgroups.txt"}.
  12624. @end deftypevr
  12625. @deftypevr {@code{prosody-configuration} parameter} boolean allow-registration?
  12626. Disable account creation by default, for security. See
  12627. @url{https://prosody.im/doc/creating_accounts}. Defaults to @samp{#f}.
  12628. @end deftypevr
  12629. @deftypevr {@code{prosody-configuration} parameter} maybe-ssl-configuration ssl
  12630. These are the SSL/TLS-related settings. Most of them are disabled so to use
  12631. Prosody's defaults. If you do not completely understand these options, do
  12632. not add them to your config, it is easy to lower the security of your server
  12633. using them. See @url{https://prosody.im/doc/advanced_ssl_config}.
  12634. Available @code{ssl-configuration} fields are:
  12635. @deftypevr {@code{ssl-configuration} parameter} maybe-string protocol
  12636. This determines what handshake to use.
  12637. @end deftypevr
  12638. @deftypevr {@code{ssl-configuration} parameter} maybe-file-name key
  12639. Path to your private key file.
  12640. @end deftypevr
  12641. @deftypevr {@code{ssl-configuration} parameter} maybe-file-name certificate
  12642. Path to your certificate file.
  12643. @end deftypevr
  12644. @deftypevr {@code{ssl-configuration} parameter} file-object capath
  12645. Path to directory containing root certificates that you wish Prosody to
  12646. trust when verifying the certificates of remote servers. Defaults to
  12647. @samp{"/etc/ssl/certs"}.
  12648. @end deftypevr
  12649. @deftypevr {@code{ssl-configuration} parameter} maybe-file-object cafile
  12650. Path to a file containing root certificates that you wish Prosody to trust.
  12651. Similar to @code{capath} but with all certificates concatenated together.
  12652. @end deftypevr
  12653. @deftypevr {@code{ssl-configuration} parameter} maybe-string-list verify
  12654. A list of verification options (these mostly map to OpenSSL's
  12655. @code{set_verify()} flags).
  12656. @end deftypevr
  12657. @deftypevr {@code{ssl-configuration} parameter} maybe-string-list options
  12658. A list of general options relating to SSL/TLS. These map to OpenSSL's
  12659. @code{set_options()}. For a full list of options available in LuaSec, see
  12660. the LuaSec source.
  12661. @end deftypevr
  12662. @deftypevr {@code{ssl-configuration} parameter} maybe-non-negative-integer depth
  12663. How long a chain of certificate authorities to check when looking for a
  12664. trusted root certificate.
  12665. @end deftypevr
  12666. @deftypevr {@code{ssl-configuration} parameter} maybe-string ciphers
  12667. An OpenSSL cipher string. This selects what ciphers Prosody will offer to
  12668. clients, and in what order.
  12669. @end deftypevr
  12670. @deftypevr {@code{ssl-configuration} parameter} maybe-file-name dhparam
  12671. A path to a file containing parameters for Diffie-Hellman key exchange. You
  12672. can create such a file with: @code{openssl dhparam -out
  12673. /etc/prosody/certs/dh-2048.pem 2048}
  12674. @end deftypevr
  12675. @deftypevr {@code{ssl-configuration} parameter} maybe-string curve
  12676. Curve for Elliptic curve Diffie-Hellman. Prosody's default is
  12677. @samp{"secp384r1"}.
  12678. @end deftypevr
  12679. @deftypevr {@code{ssl-configuration} parameter} maybe-string-list verifyext
  12680. A list of "extra" verification options.
  12681. @end deftypevr
  12682. @deftypevr {@code{ssl-configuration} parameter} maybe-string password
  12683. Password for encrypted private keys.
  12684. @end deftypevr
  12685. @end deftypevr
  12686. @deftypevr {@code{prosody-configuration} parameter} boolean c2s-require-encryption?
  12687. Whether to force all client-to-server connections to be encrypted or not.
  12688. See @url{https://prosody.im/doc/modules/mod_tls}. Defaults to @samp{#f}.
  12689. @end deftypevr
  12690. @deftypevr {@code{prosody-configuration} parameter} string-list disable-sasl-mechanisms
  12691. Set of mechanisms that will never be offered. See
  12692. @url{https://prosody.im/doc/modules/mod_saslauth}. Defaults to
  12693. @samp{("DIGEST-MD5")}.
  12694. @end deftypevr
  12695. @deftypevr {@code{prosody-configuration} parameter} boolean s2s-require-encryption?
  12696. Whether to force all server-to-server connections to be encrypted or not.
  12697. See @url{https://prosody.im/doc/modules/mod_tls}. Defaults to @samp{#f}.
  12698. @end deftypevr
  12699. @deftypevr {@code{prosody-configuration} parameter} boolean s2s-secure-auth?
  12700. Whether to require encryption and certificate authentication. This provides
  12701. ideal security, but requires servers you communicate with to support
  12702. encryption AND present valid, trusted certificates. See
  12703. @url{https://prosody.im/doc/s2s#security}. Defaults to @samp{#f}.
  12704. @end deftypevr
  12705. @deftypevr {@code{prosody-configuration} parameter} string-list s2s-insecure-domains
  12706. Many servers don't support encryption or have invalid or self-signed
  12707. certificates. You can list domains here that will not be required to
  12708. authenticate using certificates. They will be authenticated using DNS. See
  12709. @url{https://prosody.im/doc/s2s#security}. Defaults to @samp{()}.
  12710. @end deftypevr
  12711. @deftypevr {@code{prosody-configuration} parameter} string-list s2s-secure-domains
  12712. Even if you leave @code{s2s-secure-auth?} disabled, you can still require
  12713. valid certificates for some domains by specifying a list here. See
  12714. @url{https://prosody.im/doc/s2s#security}. Defaults to @samp{()}.
  12715. @end deftypevr
  12716. @deftypevr {@code{prosody-configuration} parameter} string authentication
  12717. Select the authentication backend to use. The default provider stores
  12718. passwords in plaintext and uses Prosody's configured data storage to store
  12719. the authentication data. If you do not trust your server please see
  12720. @url{https://prosody.im/doc/modules/mod_auth_internal_hashed} for
  12721. information about using the hashed backend. See also
  12722. @url{https://prosody.im/doc/authentication} Defaults to
  12723. @samp{"internal_plain"}.
  12724. @end deftypevr
  12725. @deftypevr {@code{prosody-configuration} parameter} maybe-string log
  12726. Set logging options. Advanced logging configuration is not yet supported by
  12727. the GuixSD Prosody Service. See @url{https://prosody.im/doc/logging}.
  12728. Defaults to @samp{"*syslog"}.
  12729. @end deftypevr
  12730. @deftypevr {@code{prosody-configuration} parameter} file-name pidfile
  12731. File to write pid in. See @url{https://prosody.im/doc/modules/mod_posix}.
  12732. Defaults to @samp{"/var/run/prosody/prosody.pid"}.
  12733. @end deftypevr
  12734. @deftypevr {@code{prosody-configuration} parameter} maybe-non-negative-integer http-max-content-size
  12735. Maximum allowed size of the HTTP body (in bytes).
  12736. @end deftypevr
  12737. @deftypevr {@code{prosody-configuration} parameter} maybe-string http-external-url
  12738. Some modules expose their own URL in various ways. This URL is built from
  12739. the protocol, host and port used. If Prosody sits behind a proxy, the
  12740. public URL will be @code{http-external-url} instead. See
  12741. @url{https://prosody.im/doc/http#external_url}.
  12742. @end deftypevr
  12743. @deftypevr {@code{prosody-configuration} parameter} virtualhost-configuration-list virtualhosts
  12744. A host in Prosody is a domain on which user accounts can be created. For
  12745. example if you want your users to have addresses like
  12746. @samp{"john.smith@@example.com"} then you need to add a host
  12747. @samp{"example.com"}. All options in this list will apply only to this
  12748. host.
  12749. Note: the name "virtual" host is used in configuration to avoid confusion
  12750. with the actual physical host that Prosody is installed on. A single
  12751. Prosody instance can serve many domains, each one defined as a VirtualHost
  12752. entry in Prosody's configuration. Conversely a server that hosts a single
  12753. domain would have just one VirtualHost entry.
  12754. See @url{https://prosody.im/doc/configure#virtual_host_settings}.
  12755. Available @code{virtualhost-configuration} fields are:
  12756. all these @code{prosody-configuration} fields: @code{admins},
  12757. @code{use-libevent?}, @code{modules-enabled}, @code{modules-disabled},
  12758. @code{groups-file}, @code{allow-registration?}, @code{ssl},
  12759. @code{c2s-require-encryption?}, @code{disable-sasl-mechanisms},
  12760. @code{s2s-require-encryption?}, @code{s2s-secure-auth?},
  12761. @code{s2s-insecure-domains}, @code{s2s-secure-domains},
  12762. @code{authentication}, @code{log}, @code{http-max-content-size},
  12763. @code{http-external-url}, @code{raw-content}, plus:
  12764. @deftypevr {@code{virtualhost-configuration} parameter} string domain
  12765. Domain you wish Prosody to serve.
  12766. @end deftypevr
  12767. @end deftypevr
  12768. @deftypevr {@code{prosody-configuration} parameter} int-component-configuration-list int-components
  12769. Components are extra services on a server which are available to clients,
  12770. usually on a subdomain of the main server (such as
  12771. @samp{"mycomponent.example.com"}). Example components might be chatroom
  12772. servers, user directories, or gateways to other protocols.
  12773. Internal components are implemented with Prosody-specific plugins. To add
  12774. an internal component, you simply fill the hostname field, and the plugin
  12775. you wish to use for the component.
  12776. See @url{https://prosody.im/doc/components}. Defaults to @samp{()}.
  12777. Available @code{int-component-configuration} fields are:
  12778. all these @code{prosody-configuration} fields: @code{admins},
  12779. @code{use-libevent?}, @code{modules-enabled}, @code{modules-disabled},
  12780. @code{groups-file}, @code{allow-registration?}, @code{ssl},
  12781. @code{c2s-require-encryption?}, @code{disable-sasl-mechanisms},
  12782. @code{s2s-require-encryption?}, @code{s2s-secure-auth?},
  12783. @code{s2s-insecure-domains}, @code{s2s-secure-domains},
  12784. @code{authentication}, @code{log}, @code{http-max-content-size},
  12785. @code{http-external-url}, @code{raw-content}, plus:
  12786. @deftypevr {@code{int-component-configuration} parameter} string hostname
  12787. Hostname of the component.
  12788. @end deftypevr
  12789. @deftypevr {@code{int-component-configuration} parameter} string plugin
  12790. Plugin you wish to use for the component.
  12791. @end deftypevr
  12792. @deftypevr {@code{int-component-configuration} parameter} maybe-mod-muc-configuration mod-muc
  12793. Multi-user chat (MUC) is Prosody's module for allowing you to create hosted
  12794. chatrooms/conferences for XMPP users.
  12795. General information on setting up and using multi-user chatrooms can be
  12796. found in the "Chatrooms" documentation
  12797. (@url{https://prosody.im/doc/chatrooms}), which you should read if you are
  12798. new to XMPP chatrooms.
  12799. See also @url{https://prosody.im/doc/modules/mod_muc}.
  12800. Available @code{mod-muc-configuration} fields are:
  12801. @deftypevr {@code{mod-muc-configuration} parameter} string name
  12802. The name to return in service discovery responses. Defaults to
  12803. @samp{"Prosody Chatrooms"}.
  12804. @end deftypevr
  12805. @deftypevr {@code{mod-muc-configuration} parameter} string-or-boolean restrict-room-creation
  12806. If @samp{#t}, this will only allow admins to create new chatrooms.
  12807. Otherwise anyone can create a room. The value @samp{"local"} restricts room
  12808. creation to users on the service's parent domain. E.g.@:
  12809. @samp{user@@example.com} can create rooms on @samp{rooms.example.com}. The
  12810. value @samp{"admin"} restricts to service administrators only. Defaults to
  12811. @samp{#f}.
  12812. @end deftypevr
  12813. @deftypevr {@code{mod-muc-configuration} parameter} non-negative-integer max-history-messages
  12814. Maximum number of history messages that will be sent to the member that has
  12815. just joined the room. Defaults to @samp{20}.
  12816. @end deftypevr
  12817. @end deftypevr
  12818. @end deftypevr
  12819. @deftypevr {@code{prosody-configuration} parameter} ext-component-configuration-list ext-components
  12820. External components use XEP-0114, which most standalone components support.
  12821. To add an external component, you simply fill the hostname field. See
  12822. @url{https://prosody.im/doc/components}. Defaults to @samp{()}.
  12823. Available @code{ext-component-configuration} fields are:
  12824. all these @code{prosody-configuration} fields: @code{admins},
  12825. @code{use-libevent?}, @code{modules-enabled}, @code{modules-disabled},
  12826. @code{groups-file}, @code{allow-registration?}, @code{ssl},
  12827. @code{c2s-require-encryption?}, @code{disable-sasl-mechanisms},
  12828. @code{s2s-require-encryption?}, @code{s2s-secure-auth?},
  12829. @code{s2s-insecure-domains}, @code{s2s-secure-domains},
  12830. @code{authentication}, @code{log}, @code{http-max-content-size},
  12831. @code{http-external-url}, @code{raw-content}, plus:
  12832. @deftypevr {@code{ext-component-configuration} parameter} string component-secret
  12833. Password which the component will use to log in.
  12834. @end deftypevr
  12835. @deftypevr {@code{ext-component-configuration} parameter} string hostname
  12836. Hostname of the component.
  12837. @end deftypevr
  12838. @end deftypevr
  12839. @deftypevr {@code{prosody-configuration} parameter} non-negative-integer-list component-ports
  12840. Port(s) Prosody listens on for component connections. Defaults to
  12841. @samp{(5347)}.
  12842. @end deftypevr
  12843. @deftypevr {@code{prosody-configuration} parameter} string component-interface
  12844. Interface Prosody listens on for component connections. Defaults to
  12845. @samp{"127.0.0.1"}.
  12846. @end deftypevr
  12847. @deftypevr {@code{prosody-configuration} parameter} maybe-raw-content raw-content
  12848. Raw content that will be added to the configuration file.
  12849. @end deftypevr
  12850. It could be that you just want to get a @code{prosody.cfg.lua} up and
  12851. running. In that case, you can pass an @code{opaque-prosody-configuration}
  12852. record as the value of @code{prosody-service-type}. As its name indicates,
  12853. an opaque configuration does not have easy reflective capabilities.
  12854. Available @code{opaque-prosody-configuration} fields are:
  12855. @deftypevr {@code{opaque-prosody-configuration} parameter} package prosody
  12856. The prosody package.
  12857. @end deftypevr
  12858. @deftypevr {@code{opaque-prosody-configuration} parameter} string prosody.cfg.lua
  12859. The contents of the @code{prosody.cfg.lua} to use.
  12860. @end deftypevr
  12861. For example, if your @code{prosody.cfg.lua} is just the empty string, you
  12862. could instantiate a prosody service like this:
  12863. @example
  12864. (service prosody-service-type
  12865. (opaque-prosody-configuration
  12866. (prosody.cfg.lua "")))
  12867. @end example
  12868. @c end of Prosody auto-generated documentation
  12869. @subsubheading BitlBee Service
  12870. @cindex IRC (Internet Relay Chat)
  12871. @cindex IRC gateway
  12872. @url{http://bitlbee.org,BitlBee} is a gateway that provides an IRC interface
  12873. to a variety of messaging protocols such as XMPP.
  12874. @defvr {Scheme Variable} bitlbee-service-type
  12875. This is the service type for the @url{http://bitlbee.org,BitlBee} IRC
  12876. gateway daemon. Its value is a @code{bitlbee-configuration} (see below).
  12877. To have BitlBee listen on port 6667 on localhost, add this line to your
  12878. services:
  12879. @example
  12880. (service bitlbee-service-type)
  12881. @end example
  12882. @end defvr
  12883. @deftp {Data Type} bitlbee-configuration
  12884. This is the configuration for BitlBee, with the following fields:
  12885. @table @asis
  12886. @item @code{interface} (default: @code{"127.0.0.1"})
  12887. @itemx @code{port} (default: @code{6667})
  12888. Listen on the network interface corresponding to the IP address specified in
  12889. @var{interface}, on @var{port}.
  12890. When @var{interface} is @code{127.0.0.1}, only local clients can connect;
  12891. when it is @code{0.0.0.0}, connections can come from any networking
  12892. interface.
  12893. @item @code{package} (default: @code{bitlbee})
  12894. The BitlBee package to use.
  12895. @item @code{plugins} (default: @code{'()})
  12896. List of plugin packages to use---e.g., @code{bitlbee-discord}.
  12897. @item @code{extra-settings} (default: @code{""})
  12898. Configuration snippet added as-is to the BitlBee configuration file.
  12899. @end table
  12900. @end deftp
  12901. @node Telefondienste
  12902. @subsubsection Telefondienste
  12903. @cindex Murmur (VoIP server)
  12904. @cindex VoIP server
  12905. This section describes how to set up and run a Murmur server. Murmur is the
  12906. server of the @uref{https://mumble.info, Mumble} voice-over-IP (VoIP) suite.
  12907. @deftp {Data Type} murmur-configuration
  12908. The service type for the Murmur server. An example configuration can look
  12909. like this:
  12910. @example
  12911. (service murmur-service-type
  12912. (murmur-configuration
  12913. (welcome-text
  12914. "Welcome to this Mumble server running on GuixSD!")
  12915. (cert-required? #t) ;disallow text password logins
  12916. (ssl-cert "/etc/letsencrypt/live/mumble.example.com/fullchain.pem")
  12917. (ssl-key "/etc/letsencrypt/live/mumble.example.com/privkey.pem")))
  12918. @end example
  12919. After reconfiguring your system, you can manually set the murmur
  12920. @code{SuperUser} password with the command that is printed during the
  12921. activation phase.
  12922. It is recommended to register a normal Mumble user account and grant it
  12923. admin or moderator rights. You can use the @code{mumble} client to login as
  12924. new normal user, register yourself, and log out. For the next step login
  12925. with the name @code{SuperUser} use the @code{SuperUser} password that you
  12926. set previously, and grant your newly registered mumble user administrator or
  12927. moderator rights and create some channels.
  12928. Available @code{murmur-configuration} fields are:
  12929. @table @asis
  12930. @item @code{package} (default: @code{mumble})
  12931. Package that contains @code{bin/murmurd}.
  12932. @item @code{user} (default: @code{"murmur"})
  12933. User who will run the Murmur server.
  12934. @item @code{group} (default: @code{"murmur"})
  12935. Group of the user who will run the murmur server.
  12936. @item @code{port} (default: @code{64738})
  12937. Port on which the server will listen.
  12938. @item @code{welcome-text} (default: @code{""})
  12939. Welcome text sent to clients when they connect.
  12940. @item @code{server-password} (default: @code{""})
  12941. Password the clients have to enter in order to connect.
  12942. @item @code{max-users} (default: @code{100})
  12943. Maximum of users that can be connected to the server at once.
  12944. @item @code{max-user-bandwidth} (default: @code{#f})
  12945. Maximum voice traffic a user can send per second.
  12946. @item @code{database-file} (default: @code{"/var/lib/murmur/db.sqlite"})
  12947. File name of the sqlite database. The service's user will become the owner
  12948. of the directory.
  12949. @item @code{log-file} (default: @code{"/var/log/murmur/murmur.log"})
  12950. File name of the log file. The service's user will become the owner of the
  12951. directory.
  12952. @item @code{autoban-attempts} (default: @code{10})
  12953. Maximum number of logins a user can make in @code{autoban-timeframe} without
  12954. getting auto banned for @code{autoban-time}.
  12955. @item @code{autoban-timeframe} (default: @code{120})
  12956. Timeframe for autoban in seconds.
  12957. @item @code{autoban-time} (default: @code{300})
  12958. Amount of time in seconds for which a client gets banned when violating the
  12959. autoban limits.
  12960. @item @code{opus-threshold} (default: @code{100})
  12961. Percentage of clients that need to support opus before switching over to
  12962. opus audio codec.
  12963. @item @code{channel-nesting-limit} (default: @code{10})
  12964. How deep channels can be nested at maximum.
  12965. @item @code{channelname-regex} (default: @code{#f})
  12966. A string in form of a Qt regular expression that channel names must conform
  12967. to.
  12968. @item @code{username-regex} (default: @code{#f})
  12969. A string in form of a Qt regular expression that user names must conform to.
  12970. @item @code{text-message-length} (default: @code{5000})
  12971. Maximum size in bytes that a user can send in one text chat message.
  12972. @item @code{image-message-length} (default: @code{(* 128 1024)})
  12973. Maximum size in bytes that a user can send in one image message.
  12974. @item @code{cert-required?} (default: @code{#f})
  12975. If it is set to @code{#t} clients that use weak password authentification
  12976. will not be accepted. Users must have completed the certificate wizard to
  12977. join.
  12978. @item @code{remember-channel?} (default: @code{#f})
  12979. Should murmur remember the last channel each user was in when they
  12980. disconnected and put them into the remembered channel when they rejoin.
  12981. @item @code{allow-html?} (default: @code{#f})
  12982. Should html be allowed in text messages, user comments, and channel
  12983. descriptions.
  12984. @item @code{allow-ping?} (default: @code{#f})
  12985. Setting to true exposes the current user count, the maximum user count, and
  12986. the server's maximum bandwidth per client to unauthenticated users. In the
  12987. Mumble client, this information is shown in the Connect dialog.
  12988. Disabling this setting will prevent public listing of the server.
  12989. @item @code{bonjour?} (default: @code{#f})
  12990. Should the server advertise itself in the local network through the bonjour
  12991. protocol.
  12992. @item @code{send-version?} (default: @code{#f})
  12993. Should the murmur server version be exposed in ping requests.
  12994. @item @code{log-days} (default: @code{31})
  12995. Murmur also stores logs in the database, which are accessible via RPC. The
  12996. default is 31 days of months, but you can set this setting to 0 to keep logs
  12997. forever, or -1 to disable logging to the database.
  12998. @item @code{obfuscate-ips?} (default: @code{#t})
  12999. Should logged ips be obfuscated to protect the privacy of users.
  13000. @item @code{ssl-cert} (default: @code{#f})
  13001. File name of the SSL/TLS certificate used for encrypted connections.
  13002. @example
  13003. (ssl-cert "/etc/letsencrypt/live/example.com/fullchain.pem")
  13004. @end example
  13005. @item @code{ssl-key} (default: @code{#f})
  13006. Filepath to the ssl private key used for encrypted connections.
  13007. @example
  13008. (ssl-key "/etc/letsencrypt/live/example.com/privkey.pem")
  13009. @end example
  13010. @item @code{ssl-dh-params} (default: @code{#f})
  13011. File name of a PEM-encoded file with Diffie-Hellman parameters for the
  13012. SSL/TLS encryption. Alternatively you set it to @code{"@@ffdhe2048"},
  13013. @code{"@@ffdhe3072"}, @code{"@@ffdhe4096"}, @code{"@@ffdhe6144"} or
  13014. @code{"@@ffdhe8192"} to use bundled parameters from RFC 7919.
  13015. @item @code{ssl-ciphers} (default: @code{#f})
  13016. The @code{ssl-ciphers} option chooses the cipher suites to make available
  13017. for use in SSL/TLS.
  13018. This option is specified using
  13019. @uref{https://www.openssl.org/docs/apps/ciphers.html#CIPHER-LIST-FORMAT,
  13020. OpenSSL cipher list notation}.
  13021. It is recommended that you try your cipher string using 'openssl ciphers
  13022. <string>' before setting it here, to get a feel for which cipher suites you
  13023. will get. After setting this option, it is recommend that you inspect your
  13024. Murmur log to ensure that Murmur is using the cipher suites that you
  13025. expected it to.
  13026. Note: Changing this option may impact the backwards compatibility of your
  13027. Murmur server, and can remove the ability for older Mumble clients to be
  13028. able to connect to it.
  13029. @item @code{public-registration} (default: @code{#f})
  13030. Must be a @code{<murmur-public-registration-configuration>} record or
  13031. @code{#f}.
  13032. You can optionally register your server in the public server list that the
  13033. @code{mumble} client shows on startup. You cannot register your server if
  13034. you have set a @code{server-password}, or set @code{allow-ping} to
  13035. @code{#f}.
  13036. It might take a few hours until it shows up in the public list.
  13037. @item @code{file} (default: @code{#f})
  13038. Optional alternative override for this configuration.
  13039. @end table
  13040. @end deftp
  13041. @deftp {Data Type} murmur-public-registration-configuration
  13042. Configuration for public registration of a murmur service.
  13043. @table @asis
  13044. @item @code{name}
  13045. This is a display name for your server. Not to be confused with the
  13046. hostname.
  13047. @item @code{password}
  13048. A password to identify your registration. Subsequent updates will need the
  13049. same password. Don't lose your password.
  13050. @item @code{url}
  13051. This should be a @code{http://} or @code{https://} link to your web site.
  13052. @item @code{hostname} (default: @code{#f})
  13053. By default your server will be listed by its IP address. If it is set your
  13054. server will be linked by this host name instead.
  13055. @end table
  13056. @end deftp
  13057. @node Überwachungsdienste
  13058. @subsubsection Überwachungsdienste
  13059. @subsubheading Tailon Service
  13060. @uref{https://tailon.readthedocs.io/, Tailon} is a web application for
  13061. viewing and searching log files.
  13062. The following example will configure the service with default values. By
  13063. default, Tailon can be accessed on port 8080 (@code{http://localhost:8080}).
  13064. @example
  13065. (service tailon-service-type)
  13066. @end example
  13067. The following example customises more of the Tailon configuration, adding
  13068. @command{sed} to the list of allowed commands.
  13069. @example
  13070. (service tailon-service-type
  13071. (tailon-configuration
  13072. (config-file
  13073. (tailon-configuration-file
  13074. (allowed-commands '("tail" "grep" "awk" "sed"))))))
  13075. @end example
  13076. @deftp {Data Type} tailon-configuration
  13077. Data type representing the configuration of Tailon. This type has the
  13078. following parameters:
  13079. @table @asis
  13080. @item @code{config-file} (default: @code{(tailon-configuration-file)})
  13081. The configuration file to use for Tailon. This can be set to a
  13082. @dfn{tailon-configuration-file} record value, or any gexp
  13083. (@pxref{G-Ausdrücke}).
  13084. For example, to instead use a local file, the @code{local-file} function can
  13085. be used:
  13086. @example
  13087. (service tailon-service-type
  13088. (tailon-configuration
  13089. (config-file (local-file "./my-tailon.conf"))))
  13090. @end example
  13091. @item @code{package} (default: @code{tailon})
  13092. The tailon package to use.
  13093. @end table
  13094. @end deftp
  13095. @deftp {Data Type} tailon-configuration-file
  13096. Data type representing the configuration options for Tailon. This type has
  13097. the following parameters:
  13098. @table @asis
  13099. @item @code{files} (default: @code{(list "/var/log")})
  13100. List of files to display. The list can include strings for a single file or
  13101. directory, or a list, where the first item is the name of a subsection, and
  13102. the remaining items are the files or directories in that subsection.
  13103. @item @code{bind} (default: @code{"localhost:8080"})
  13104. Address and port to which Tailon should bind on.
  13105. @item @code{relative-root} (default: @code{#f})
  13106. URL path to use for Tailon, set to @code{#f} to not use a path.
  13107. @item @code{allow-transfers?} (default: @code{#t})
  13108. Allow downloading the log files in the web interface.
  13109. @item @code{follow-names?} (default: @code{#t})
  13110. Allow tailing of not-yet existent files.
  13111. @item @code{tail-lines} (default: @code{200})
  13112. Number of lines to read initially from each file.
  13113. @item @code{allowed-commands} (default: @code{(list "tail" "grep" "awk")})
  13114. Commands to allow running. By default, @code{sed} is disabled.
  13115. @item @code{debug?} (default: @code{#f})
  13116. Set @code{debug?} to @code{#t} to show debug messages.
  13117. @item @code{wrap-lines} (default: @code{#t})
  13118. Initial line wrapping state in the web interface. Set to @code{#t} to
  13119. initially wrap lines (the default), or to @code{#f} to initially not wrap
  13120. lines.
  13121. @item @code{http-auth} (default: @code{#f})
  13122. HTTP authentication type to use. Set to @code{#f} to disable authentication
  13123. (the default). Supported values are @code{"digest"} or @code{"basic"}.
  13124. @item @code{users} (default: @code{#f})
  13125. If HTTP authentication is enabled (see @code{http-auth}), access will be
  13126. restricted to the credentials provided here. To configure users, use a list
  13127. of pairs, where the first element of the pair is the username, and the 2nd
  13128. element of the pair is the password.
  13129. @example
  13130. (tailon-configuration-file
  13131. (http-auth "basic")
  13132. (users '(("user1" . "password1")
  13133. ("user2" . "password2"))))
  13134. @end example
  13135. @end table
  13136. @end deftp
  13137. @subsubheading Darkstat Service
  13138. @cindex darkstat
  13139. Darkstat is a packet sniffer that captures network traffic, calculates
  13140. statistics about usage, and serves reports over HTTP.
  13141. @defvar {Scheme Variable} darkstat-service-type
  13142. This is the service type for the @uref{https://unix4lyfe.org/darkstat/,
  13143. darkstat} service, its value must be a @code{darkstat-configuration} record
  13144. as in this example:
  13145. @example
  13146. (service darkstat-service-type
  13147. (darkstat-configuration
  13148. (interface "eno1")))
  13149. @end example
  13150. @end defvar
  13151. @deftp {Data Type} darkstat-configuration
  13152. Data type representing the configuration of @command{darkstat}.
  13153. @table @asis
  13154. @item @code{package} (default: @code{darkstat})
  13155. The darkstat package to use.
  13156. @item @code{interface}
  13157. Capture traffic on the specified network interface.
  13158. @item @code{port} (default: @code{"667"})
  13159. Bind the web interface to the specified port.
  13160. @item @code{bind-address} (default: @code{"127.0.0.1"})
  13161. Bind the web interface to the specified address.
  13162. @item @code{base} (default: @code{"/"})
  13163. Specify the path of the base URL. This can be useful if @command{darkstat}
  13164. is accessed via a reverse proxy.
  13165. @end table
  13166. @end deftp
  13167. @subsubheading Prometheus Node Exporter Service
  13168. @cindex prometheus-node-exporter
  13169. The Prometheus ``node exporter'' makes hardware and operating system
  13170. statistics provided by the Linux kernel available for the Prometheus
  13171. monitoring system. This service should be deployed on all physical nodes
  13172. and virtual machines, where monitoring these statistics is desirable.
  13173. @defvar {Scheme variable} prometheus-node-exporter-service-type
  13174. This is the service type for the
  13175. @uref{https://github.com/prometheus/node_exporter/,
  13176. prometheus-node-exporter} service, its value must be a
  13177. @code{prometheus-node-exporter-configuration} record as in this example:
  13178. @example
  13179. (service prometheus-node-exporter-service-type
  13180. (prometheus-node-exporter-configuration
  13181. (web-listen-address ":9100")))
  13182. @end example
  13183. @end defvar
  13184. @deftp {Data Type} prometheus-node-exporter-configuration
  13185. Data type representing the configuration of @command{node_exporter}.
  13186. @table @asis
  13187. @item @code{package} (default: @code{go-github-com-prometheus-node-exporter})
  13188. The prometheus-node-exporter package to use.
  13189. @item @code{web-listen-address} (default: @code{":9100"})
  13190. Bind the web interface to the specified address.
  13191. @end table
  13192. @end deftp
  13193. @node Kerberos-Dienste
  13194. @subsubsection Kerberos-Dienste
  13195. @cindex Kerberos
  13196. The @code{(gnu services kerberos)} module provides services relating to the
  13197. authentication protocol @dfn{Kerberos}.
  13198. @subsubheading Krb5 Service
  13199. Programs using a Kerberos client library normally expect a configuration
  13200. file in @file{/etc/krb5.conf}. This service generates such a file from a
  13201. definition provided in the operating system declaration. It does not cause
  13202. any daemon to be started.
  13203. No ``keytab'' files are provided by this service---you must explicitly
  13204. create them. This service is known to work with the MIT client library,
  13205. @code{mit-krb5}. Other implementations have not been tested.
  13206. @defvr {Scheme Variable} krb5-service-type
  13207. A service type for Kerberos 5 clients.
  13208. @end defvr
  13209. @noindent
  13210. Here is an example of its use:
  13211. @lisp
  13212. (service krb5-service-type
  13213. (krb5-configuration
  13214. (default-realm "EXAMPLE.COM")
  13215. (allow-weak-crypto? #t)
  13216. (realms (list
  13217. (krb5-realm
  13218. (name "EXAMPLE.COM")
  13219. (admin-server "groucho.example.com")
  13220. (kdc "karl.example.com"))
  13221. (krb5-realm
  13222. (name "ARGRX.EDU")
  13223. (admin-server "kerb-admin.argrx.edu")
  13224. (kdc "keys.argrx.edu"))))))
  13225. @end lisp
  13226. @noindent
  13227. This example provides a Kerberos@tie{}5 client configuration which:
  13228. @itemize
  13229. @item Recognizes two realms, @i{viz:} ``EXAMPLE.COM'' and ``ARGRX.EDU'', both
  13230. of which have distinct administration servers and key distribution centers;
  13231. @item Will default to the realm ``EXAMPLE.COM'' if the realm is not explicitly
  13232. specified by clients;
  13233. @item Accepts services which only support encryption types known to be weak.
  13234. @end itemize
  13235. The @code{krb5-realm} and @code{krb5-configuration} types have many fields.
  13236. Only the most commonly used ones are described here. For a full list, and
  13237. more detailed explanation of each, see the MIT
  13238. @uref{http://web.mit.edu/kerberos/krb5-devel/doc/admin/conf_files/krb5_conf.html,,krb5.conf}
  13239. documentation.
  13240. @deftp {Data Type} krb5-realm
  13241. @cindex realm, kerberos
  13242. @table @asis
  13243. @item @code{name}
  13244. This field is a string identifying the name of the realm. A common
  13245. convention is to use the fully qualified DNS name of your organization,
  13246. converted to upper case.
  13247. @item @code{admin-server}
  13248. This field is a string identifying the host where the administration server
  13249. is running.
  13250. @item @code{kdc}
  13251. This field is a string identifying the key distribution center for the
  13252. realm.
  13253. @end table
  13254. @end deftp
  13255. @deftp {Data Type} krb5-configuration
  13256. @table @asis
  13257. @item @code{allow-weak-crypto?} (default: @code{#f})
  13258. If this flag is @code{#t} then services which only offer encryption
  13259. algorithms known to be weak will be accepted.
  13260. @item @code{default-realm} (default: @code{#f})
  13261. This field should be a string identifying the default Kerberos realm for the
  13262. client. You should set this field to the name of your Kerberos realm. If
  13263. this value is @code{#f} then a realm must be specified with every Kerberos
  13264. principal when invoking programs such as @command{kinit}.
  13265. @item @code{realms}
  13266. This should be a non-empty list of @code{krb5-realm} objects, which clients
  13267. may access. Normally, one of them will have a @code{name} field matching
  13268. the @code{default-realm} field.
  13269. @end table
  13270. @end deftp
  13271. @subsubheading PAM krb5 Service
  13272. @cindex pam-krb5
  13273. The @code{pam-krb5} service allows for login authentication and password
  13274. management via Kerberos. You will need this service if you want PAM enabled
  13275. applications to authenticate users using Kerberos.
  13276. @defvr {Scheme Variable} pam-krb5-service-type
  13277. A service type for the Kerberos 5 PAM module.
  13278. @end defvr
  13279. @deftp {Data Type} pam-krb5-configuration
  13280. Data type representing the configuration of the Kerberos 5 PAM module This
  13281. type has the following parameters:
  13282. @table @asis
  13283. @item @code{pam-krb5} (default: @code{pam-krb5})
  13284. The pam-krb5 package to use.
  13285. @item @code{minimum-uid} (default: @code{1000})
  13286. The smallest user ID for which Kerberos authentications should be
  13287. attempted. Local accounts with lower values will silently fail to
  13288. authenticate.
  13289. @end table
  13290. @end deftp
  13291. @node Web-Dienste
  13292. @subsubsection Web-Dienste
  13293. @cindex web
  13294. @cindex www
  13295. @cindex HTTP
  13296. The @code{(gnu services web)} module provides the Apache HTTP Server, the
  13297. nginx web server, and also a fastcgi wrapper daemon.
  13298. @subsubheading Apache HTTP Server
  13299. @deffn {Scheme Variable} httpd-service-type
  13300. Service type for the @uref{https://httpd.apache.org/,Apache HTTP} server
  13301. (@dfn{httpd}). The value for this service type is a
  13302. @code{httpd-configuration} record.
  13303. A simple example configuration is given below.
  13304. @example
  13305. (service httpd-service-type
  13306. (httpd-configuration
  13307. (config
  13308. (httpd-config-file
  13309. (server-name "www.example.com")
  13310. (document-root "/srv/http/www.example.com")))))
  13311. @end example
  13312. Other services can also extend the @code{httpd-service-type} to add to the
  13313. configuration.
  13314. @example
  13315. (simple-service 'my-extra-server httpd-service-type
  13316. (list
  13317. (httpd-virtualhost
  13318. "*:80"
  13319. (list (string-append
  13320. "ServerName "www.example.com
  13321. DocumentRoot \"/srv/http/www.example.com\"")))))
  13322. @end example
  13323. @end deffn
  13324. The details for the @code{httpd-configuration}, @code{httpd-module},
  13325. @code{httpd-config-file} and @code{httpd-virtualhost} record types are given
  13326. below.
  13327. @deffn {Data Type} httpd-configuration
  13328. This data type represents the configuration for the httpd service.
  13329. @table @asis
  13330. @item @code{package} (default: @code{httpd})
  13331. The httpd package to use.
  13332. @item @code{pid-file} (default: @code{"/var/run/httpd"})
  13333. The pid file used by the shepherd-service.
  13334. @item @code{config} (default: @code{(httpd-config-file)})
  13335. The configuration file to use with the httpd service. The default value is a
  13336. @code{httpd-config-file} record, but this can also be a different
  13337. G-expression that generates a file, for example a @code{plain-file}. A file
  13338. outside of the store can also be specified through a string.
  13339. @end table
  13340. @end deffn
  13341. @deffn {Data Type} httpd-module
  13342. This data type represents a module for the httpd service.
  13343. @table @asis
  13344. @item @code{name}
  13345. The name of the module.
  13346. @item @code{file}
  13347. The file for the module. This can be relative to the httpd package being
  13348. used, the absolute location of a file, or a G-expression for a file within
  13349. the store, for example @code{(file-append mod-wsgi "/modules/mod_wsgi.so")}.
  13350. @end table
  13351. @end deffn
  13352. @defvr {Scheme Variable} %default-httpd-modules
  13353. A default list of @code{httpd-module} objects.
  13354. @end defvr
  13355. @deffn {Data Type} httpd-config-file
  13356. This data type represents a configuration file for the httpd service.
  13357. @table @asis
  13358. @item @code{modules} (default: @code{%default-httpd-modules})
  13359. The modules to load. Additional modules can be added here, or loaded by
  13360. additional configuration.
  13361. For example, in order to handle requests for PHP files, you can use Apache’s
  13362. @code{mod_proxy_fcgi} module along with @code{php-fpm-service-type}:
  13363. @example
  13364. (service httpd-service-type
  13365. (httpd-configuration
  13366. (config
  13367. (httpd-config-file
  13368. (modules (cons*
  13369. (httpd-module
  13370. (name "proxy_module")
  13371. (file "modules/mod_proxy.so"))
  13372. (httpd-module
  13373. (name "proxy_fcgi_module")
  13374. (file "modules/mod_proxy_fcgi.so"))
  13375. %default-httpd-modules))
  13376. (extra-config (list "\
  13377. <FilesMatch \\.php$>
  13378. SetHandler \"proxy:unix:/var/run/php-fpm.sock|fcgi://localhost/\"
  13379. </FilesMatch>"))))))
  13380. (service php-fpm-service-type
  13381. (php-fpm-configuration
  13382. (socket "/var/run/php-fpm.sock")
  13383. (socket-group "httpd")))
  13384. @end example
  13385. @item @code{server-root} (default: @code{httpd})
  13386. The @code{ServerRoot} in the configuration file, defaults to the httpd
  13387. package. Directives including @code{Include} and @code{LoadModule} are taken
  13388. as relative to the server root.
  13389. @item @code{server-name} (default: @code{#f})
  13390. The @code{ServerName} in the configuration file, used to specify the request
  13391. scheme, hostname and port that the server uses to identify itself.
  13392. This doesn't need to be set in the server config, and can be specifyed in
  13393. virtual hosts. The default is @code{#f} to not specify a @code{ServerName}.
  13394. @item @code{document-root} (default: @code{"/srv/http"})
  13395. The @code{DocumentRoot} from which files will be served.
  13396. @item @code{listen} (default: @code{'("80")})
  13397. The list of values for the @code{Listen} directives in the config file. The
  13398. value should be a list of strings, when each string can specify the port
  13399. number to listen on, and optionally the IP address and protocol to use.
  13400. @item @code{pid-file} (default: @code{"/var/run/httpd"})
  13401. The @code{PidFile} to use. This should match the @code{pid-file} set in the
  13402. @code{httpd-configuration} so that the Shepherd service is configured
  13403. correctly.
  13404. @item @code{error-log} (default: @code{"/var/log/httpd/error_log"})
  13405. The @code{ErrorLog} to which the server will log errors.
  13406. @item @code{user} (default: @code{"httpd"})
  13407. The @code{User} which the server will answer requests as.
  13408. @item @code{group} (default: @code{"httpd"})
  13409. The @code{Group} which the server will answer requests as.
  13410. @item @code{extra-config} (default: @code{(list "TypesConfig etc/httpd/mime.types")})
  13411. A flat list of strings and G-expressions which will be added to the end of
  13412. the configuration file.
  13413. Any values which the service is extended with will be appended to this list.
  13414. @end table
  13415. @end deffn
  13416. @deffn {Data Type} httpd-virtualhost
  13417. This data type represents a virtualhost configuration block for the httpd
  13418. service.
  13419. These should be added to the extra-config for the httpd-service.
  13420. @example
  13421. (simple-service 'my-extra-server httpd-service-type
  13422. (list
  13423. (httpd-virtualhost
  13424. "*:80"
  13425. (list (string-append
  13426. "ServerName "www.example.com
  13427. DocumentRoot \"/srv/http/www.example.com\"")))))
  13428. @end example
  13429. @table @asis
  13430. @item @code{addresses-and-ports}
  13431. The addresses and ports for the @code{VirtualHost} directive.
  13432. @item @code{contents}
  13433. The contents of the @code{VirtualHost} directive, this should be a list of
  13434. strings and G-expressions.
  13435. @end table
  13436. @end deffn
  13437. @subsubheading NGINX
  13438. @deffn {Scheme Variable} nginx-service-type
  13439. Service type for the @uref{https://nginx.org/,NGinx} web server. The value
  13440. for this service type is a @code{<nginx-configuration>} record.
  13441. A simple example configuration is given below.
  13442. @example
  13443. (service nginx-service-type
  13444. (nginx-configuration
  13445. (server-blocks
  13446. (list (nginx-server-configuration
  13447. (server-name '("www.example.com"))
  13448. (root "/srv/http/www.example.com"))))))
  13449. @end example
  13450. In addition to adding server blocks to the service configuration directly,
  13451. this service can be extended by other services to add server blocks, as in
  13452. this example:
  13453. @example
  13454. (simple-service 'my-extra-server nginx-service-type
  13455. (list (nginx-server-configuration
  13456. (root "/srv/http/extra-website")
  13457. (try-files (list "$uri" "$uri/index.html")))))
  13458. @end example
  13459. @end deffn
  13460. At startup, @command{nginx} has not yet read its configuration file, so it
  13461. uses a default file to log error messages. If it fails to load its
  13462. configuration file, that is where error messages are logged. After the
  13463. configuration file is loaded, the default error log file changes as per
  13464. configuration. In our case, startup error messages can be found in
  13465. @file{/var/run/nginx/logs/error.log}, and after configuration in
  13466. @file{/var/log/nginx/error.log}. The second location can be changed with
  13467. the @var{log-directory} configuration option.
  13468. @deffn {Data Type} nginx-configuration
  13469. This data type represents the configuration for NGinx. Some configuration
  13470. can be done through this and the other provided record types, or
  13471. alternatively, a config file can be provided.
  13472. @table @asis
  13473. @item @code{nginx} (default: @code{nginx})
  13474. The nginx package to use.
  13475. @item @code{log-directory} (default: @code{"/var/log/nginx"})
  13476. The directory to which NGinx will write log files.
  13477. @item @code{run-directory} (default: @code{"/var/run/nginx"})
  13478. The directory in which NGinx will create a pid file, and write temporary
  13479. files.
  13480. @item @code{server-blocks} (default: @code{'()})
  13481. A list of @dfn{server blocks} to create in the generated configuration file,
  13482. the elements should be of type @code{<nginx-server-configuration>}.
  13483. The following example would setup NGinx to serve @code{www.example.com} from
  13484. the @code{/srv/http/www.example.com} directory, without using HTTPS.
  13485. @example
  13486. (service nginx-service-type
  13487. (nginx-configuration
  13488. (server-blocks
  13489. (list (nginx-server-configuration
  13490. (server-name '("www.example.com"))
  13491. (root "/srv/http/www.example.com"))))))
  13492. @end example
  13493. @item @code{upstream-blocks} (default: @code{'()})
  13494. A list of @dfn{upstream blocks} to create in the generated configuration
  13495. file, the elements should be of type @code{<nginx-upstream-configuration>}.
  13496. Configuring upstreams through the @code{upstream-blocks} can be useful when
  13497. combined with @code{locations} in the @code{<nginx-server-configuration>}
  13498. records. The following example creates a server configuration with one
  13499. location configuration, that will proxy requests to a upstream
  13500. configuration, which will handle requests with two servers.
  13501. @example
  13502. (service
  13503. nginx-service-type
  13504. (nginx-configuration
  13505. (server-blocks
  13506. (list (nginx-server-configuration
  13507. (server-name '("www.example.com"))
  13508. (root "/srv/http/www.example.com")
  13509. (locations
  13510. (list
  13511. (nginx-location-configuration
  13512. (uri "/path1")
  13513. (body '("proxy_pass http://server-proxy;"))))))))
  13514. (upstream-blocks
  13515. (list (nginx-upstream-configuration
  13516. (name "server-proxy")
  13517. (servers (list "server1.example.com"
  13518. "server2.example.com")))))))
  13519. @end example
  13520. @item @code{file} (default: @code{#f})
  13521. If a configuration @var{file} is provided, this will be used, rather than
  13522. generating a configuration file from the provided @code{log-directory},
  13523. @code{run-directory}, @code{server-blocks} and @code{upstream-blocks}. For
  13524. proper operation, these arguments should match what is in @var{file} to
  13525. ensure that the directories are created when the service is activated.
  13526. This can be useful if you have an existing configuration file, or it's not
  13527. possible to do what is required through the other parts of the
  13528. nginx-configuration record.
  13529. @item @code{server-names-hash-bucket-size} (default: @code{#f})
  13530. Bucket size for the server names hash tables, defaults to @code{#f} to use
  13531. the size of the processors cache line.
  13532. @item @code{server-names-hash-bucket-max-size} (default: @code{#f})
  13533. Maximum bucket size for the server names hash tables.
  13534. @item @code{extra-content} (default: @code{""})
  13535. Extra content for the @code{http} block. Should be string or a string
  13536. valued G-expression.
  13537. @end table
  13538. @end deffn
  13539. @deftp {Data Type} nginx-server-configuration
  13540. Data type representing the configuration of an nginx server block. This
  13541. type has the following parameters:
  13542. @table @asis
  13543. @item @code{listen} (default: @code{'("80" "443 ssl")})
  13544. Each @code{listen} directive sets the address and port for IP, or the path
  13545. for a UNIX-domain socket on which the server will accept requests. Both
  13546. address and port, or only address or only port can be specified. An address
  13547. may also be a hostname, for example:
  13548. @example
  13549. '("127.0.0.1:8000" "127.0.0.1" "8000" "*:8000" "localhost:8000")
  13550. @end example
  13551. @item @code{server-name} (default: @code{(list 'default)})
  13552. A list of server names this server represents. @code{'default} represents
  13553. the default server for connections matching no other server.
  13554. @item @code{root} (default: @code{"/srv/http"})
  13555. Root of the website nginx will serve.
  13556. @item @code{locations} (default: @code{'()})
  13557. A list of @dfn{nginx-location-configuration} or
  13558. @dfn{nginx-named-location-configuration} records to use within this server
  13559. block.
  13560. @item @code{index} (default: @code{(list "index.html")})
  13561. Index files to look for when clients ask for a directory. If it cannot be
  13562. found, Nginx will send the list of files in the directory.
  13563. @item @code{try-files} (default: @code{'()})
  13564. A list of files whose existence is checked in the specified order.
  13565. @code{nginx} will use the first file it finds to process the request.
  13566. @item @code{ssl-certificate} (default: @code{#f})
  13567. Where to find the certificate for secure connections. Set it to @code{#f}
  13568. if you don't have a certificate or you don't want to use HTTPS.
  13569. @item @code{ssl-certificate-key} (default: @code{#f})
  13570. Where to find the private key for secure connections. Set it to @code{#f}
  13571. if you don't have a key or you don't want to use HTTPS.
  13572. @item @code{server-tokens?} (default: @code{#f})
  13573. Whether the server should add its configuration to response.
  13574. @item @code{raw-content} (default: @code{'()})
  13575. A list of raw lines added to the server block.
  13576. @end table
  13577. @end deftp
  13578. @deftp {Data Type} nginx-upstream-configuration
  13579. Data type representing the configuration of an nginx @code{upstream} block.
  13580. This type has the following parameters:
  13581. @table @asis
  13582. @item @code{name}
  13583. Name for this group of servers.
  13584. @item @code{servers}
  13585. Specify the addresses of the servers in the group. The address can be
  13586. specified as a IP address (e.g.@: @samp{127.0.0.1}), domain name (e.g.@:
  13587. @samp{backend1.example.com}) or a path to a UNIX socket using the prefix
  13588. @samp{unix:}. For addresses using an IP address or domain name, the default
  13589. port is 80, and a different port can be specified explicitly.
  13590. @end table
  13591. @end deftp
  13592. @deftp {Data Type} nginx-location-configuration
  13593. Data type representing the configuration of an nginx @code{location} block.
  13594. This type has the following parameters:
  13595. @table @asis
  13596. @item @code{uri}
  13597. URI which this location block matches.
  13598. @anchor{nginx-location-configuration body}
  13599. @item @code{body}
  13600. Body of the location block, specified as a list of strings. This can contain
  13601. many configuration directives. For example, to pass requests to a upstream
  13602. server group defined using an @code{nginx-upstream-configuration} block, the
  13603. following directive would be specified in the body @samp{(list "proxy_pass
  13604. http://upstream-name;")}.
  13605. @end table
  13606. @end deftp
  13607. @deftp {Data Type} nginx-named-location-configuration
  13608. Data type representing the configuration of an nginx named location block.
  13609. Named location blocks are used for request redirection, and not used for
  13610. regular request processing. This type has the following parameters:
  13611. @table @asis
  13612. @item @code{name}
  13613. Name to identify this location block.
  13614. @item @code{body}
  13615. @xref{nginx-location-configuration body}, as the body for named location
  13616. blocks can be used in a similar way to the
  13617. @code{nginx-location-configuration body}. One restriction is that the body
  13618. of a named location block cannot contain location blocks.
  13619. @end table
  13620. @end deftp
  13621. @subsubheading Varnish Cache
  13622. @cindex Varnish
  13623. Varnish is a fast cache server that sits in between web applications and end
  13624. users. It proxies requests from clients and caches the accessed URLs such
  13625. that multiple requests for the same resource only creates one request to the
  13626. back-end.
  13627. @defvr {Scheme Variable} varnish-service-type
  13628. Service type for the Varnish daemon.
  13629. @end defvr
  13630. @deftp {Data Type} varnish-configuration
  13631. Data type representing the @code{varnish} service configuration. This type
  13632. has the following parameters:
  13633. @table @asis
  13634. @item @code{package} (default: @code{varnish})
  13635. The Varnish package to use.
  13636. @item @code{name} (default: @code{"default"})
  13637. A name for this Varnish instance. Varnish will create a directory in
  13638. @file{/var/varnish/} with this name and keep temporary files there. If the
  13639. name starts with a forward slash, it is interpreted as an absolute directory
  13640. name.
  13641. Pass the @code{-n} argument to other Varnish programs to connect to the
  13642. named instance, e.g.@: @command{varnishncsa -n default}.
  13643. @item @code{backend} (default: @code{"localhost:8080"})
  13644. The backend to use. This option has no effect if @code{vcl} is set.
  13645. @item @code{vcl} (default: #f)
  13646. The @dfn{VCL} (Varnish Configuration Language) program to run. If this is
  13647. @code{#f}, Varnish will proxy @code{backend} using the default
  13648. configuration. Otherwise this must be a file-like object with valid VCL
  13649. syntax.
  13650. @c Varnish does not support HTTPS, so keep this URL to avoid confusion.
  13651. For example, to mirror @url{http://www.gnu.org,www.gnu.org} with VCL you can
  13652. do something along these lines:
  13653. @example
  13654. (define %gnu-mirror
  13655. (plain-file
  13656. "gnu.vcl"
  13657. "vcl 4.1;
  13658. backend gnu @{ .host = "www.gnu.org"; @}"))
  13659. (operating-system
  13660. ...
  13661. (services (cons (service varnish-service-type
  13662. (varnish-configuration
  13663. (listen '(":80"))
  13664. (vcl %gnu-mirror)))
  13665. %base-services)))
  13666. @end example
  13667. The configuration of an already running Varnish instance can be inspected
  13668. and changed using the @command{varnishadm} program.
  13669. Consult the @url{https://varnish-cache.org/docs/,Varnish User Guide} and
  13670. @url{https://book.varnish-software.com/4.0/,Varnish Book} for comprehensive
  13671. documentation on Varnish and its configuration language.
  13672. @item @code{listen} (default: @code{'("localhost:80")})
  13673. List of addresses Varnish will listen on.
  13674. @item @code{storage} (default: @code{'("malloc,128m")})
  13675. List of storage backends that will be available in VCL.
  13676. @item @code{parameters} (default: @code{'()})
  13677. List of run-time parameters in the form @code{'(("parameter" . "value"))}.
  13678. @item @code{extra-options} (default: @code{'()})
  13679. Additional arguments to pass to the @command{varnishd} process.
  13680. @end table
  13681. @end deftp
  13682. @subsubheading FastCGI
  13683. @cindex fastcgi
  13684. @cindex fcgiwrap
  13685. FastCGI is an interface between the front-end and the back-end of a web
  13686. service. It is a somewhat legacy facility; new web services should
  13687. generally just talk HTTP between the front-end and the back-end. However
  13688. there are a number of back-end services such as PHP or the optimized HTTP
  13689. Git repository access that use FastCGI, so we have support for it in Guix.
  13690. To use FastCGI, you configure the front-end web server (e.g., nginx) to
  13691. dispatch some subset of its requests to the fastcgi backend, which listens
  13692. on a local TCP or UNIX socket. There is an intermediary @code{fcgiwrap}
  13693. program that sits between the actual backend process and the web server.
  13694. The front-end indicates which backend program to run, passing that
  13695. information to the @code{fcgiwrap} process.
  13696. @defvr {Scheme Variable} fcgiwrap-service-type
  13697. A service type for the @code{fcgiwrap} FastCGI proxy.
  13698. @end defvr
  13699. @deftp {Data Type} fcgiwrap-configuration
  13700. Data type representing the configuration of the @code{fcgiwrap} serice.
  13701. This type has the following parameters:
  13702. @table @asis
  13703. @item @code{package} (default: @code{fcgiwrap})
  13704. The fcgiwrap package to use.
  13705. @item @code{socket} (default: @code{tcp:127.0.0.1:9000})
  13706. The socket on which the @code{fcgiwrap} process should listen, as a string.
  13707. Valid @var{socket} values include @code{unix:@var{/path/to/unix/socket}},
  13708. @code{tcp:@var{dot.ted.qu.ad}:@var{port}} and
  13709. @code{tcp6:[@var{ipv6_addr}]:port}.
  13710. @item @code{user} (default: @code{fcgiwrap})
  13711. @itemx @code{group} (default: @code{fcgiwrap})
  13712. The user and group names, as strings, under which to run the @code{fcgiwrap}
  13713. process. The @code{fastcgi} service will ensure that if the user asks for
  13714. the specific user or group names @code{fcgiwrap} that the corresponding user
  13715. and/or group is present on the system.
  13716. It is possible to configure a FastCGI-backed web service to pass HTTP
  13717. authentication information from the front-end to the back-end, and to allow
  13718. @code{fcgiwrap} to run the back-end process as a corresponding local user.
  13719. To enable this capability on the back-end., run @code{fcgiwrap} as the
  13720. @code{root} user and group. Note that this capability also has to be
  13721. configured on the front-end as well.
  13722. @end table
  13723. @end deftp
  13724. @cindex php-fpm
  13725. PHP-FPM (FastCGI Process Manager) is an alternative PHP FastCGI
  13726. implementation with some additional features useful for sites of any size.
  13727. These features include:
  13728. @itemize @bullet
  13729. @item Adaptive process spawning
  13730. @item Basic statistics (similar to Apache's mod_status)
  13731. @item Advanced process management with graceful stop/start
  13732. @item Ability to start workers with different uid/gid/chroot/environment
  13733. and different php.ini (replaces safe_mode)
  13734. @item Stdout & stderr logging
  13735. @item Emergency restart in case of accidental opcode cache destruction
  13736. @item Accelerated upload support
  13737. @item Support for a "slowlog"
  13738. @item Enhancements to FastCGI, such as fastcgi_finish_request() -
  13739. a special function to finish request & flush all data while continuing to do
  13740. something time-consuming (video converting, stats processing, etc.)
  13741. @end itemize
  13742. ...@: and much more.
  13743. @defvr {Scheme Variable} php-fpm-service-type
  13744. A Service type for @code{php-fpm}.
  13745. @end defvr
  13746. @deftp {Data Type} php-fpm-configuration
  13747. Data Type for php-fpm service configuration.
  13748. @table @asis
  13749. @item @code{php} (default: @code{php})
  13750. The php package to use.
  13751. @item @code{socket} (default: @code{(string-append "/var/run/php" (version-major (package-version php)) "-fpm.sock")})
  13752. The address on which to accept FastCGI requests. Valid syntaxes are:
  13753. @table @asis
  13754. @item @code{"ip.add.re.ss:port"}
  13755. Listen on a TCP socket to a specific address on a specific port.
  13756. @item @code{"port"}
  13757. Listen on a TCP socket to all addresses on a specific port.
  13758. @item @code{"/path/to/unix/socket"}
  13759. Listen on a unix socket.
  13760. @end table
  13761. @item @code{user} (default: @code{php-fpm})
  13762. User who will own the php worker processes.
  13763. @item @code{group} (default: @code{php-fpm})
  13764. Group of the worker processes.
  13765. @item @code{socket-user} (default: @code{php-fpm})
  13766. User who can speak to the php-fpm socket.
  13767. @item @code{socket-group} (default: @code{php-fpm})
  13768. Group that can speak to the php-fpm socket.
  13769. @item @code{pid-file} (default: @code{(string-append "/var/run/php" (version-major (package-version php)) "-fpm.pid")})
  13770. The process id of the php-fpm process is written to this file once the
  13771. service has started.
  13772. @item @code{log-file} (default: @code{(string-append "/var/log/php" (version-major (package-version php)) "-fpm.log")})
  13773. Log for the php-fpm master process.
  13774. @item @code{process-manager} (default: @code{(php-fpm-dynamic-process-manager-configuration)})
  13775. Detailed settings for the php-fpm process manager. Must be either:
  13776. @table @asis
  13777. @item @code{<php-fpm-dynamic-process-manager-configuration>}
  13778. @item @code{<php-fpm-static-process-manager-configuration>}
  13779. @item @code{<php-fpm-on-demand-process-manager-configuration>}
  13780. @end table
  13781. @item @code{display-errors} (default @code{#f})
  13782. Determines whether php errors and warning should be sent to clients and
  13783. displayed in their browsers. This is useful for local php development, but
  13784. a security risk for public sites, as error messages can reveal passwords and
  13785. personal data.
  13786. @item @code{workers-logfile} (default @code{(string-append "/var/log/php" (version-major (package-version php)) "-fpm.www.log")})
  13787. This file will log the @code{stderr} outputs of php worker processes. Can
  13788. be set to @code{#f} to disable logging.
  13789. @item @code{file} (default @code{#f})
  13790. An optional override of the whole configuration. You can use the
  13791. @code{mixed-text-file} function or an absolute filepath for it.
  13792. @end table
  13793. @end deftp
  13794. @deftp {Data type} php-fpm-dynamic-process-manager-configuration
  13795. Data Type for the @code{dynamic} php-fpm process manager. With the
  13796. @code{dynamic} process manager, spare worker processes are kept around based
  13797. on it's configured limits.
  13798. @table @asis
  13799. @item @code{max-children} (default: @code{5})
  13800. Maximum of worker processes.
  13801. @item @code{start-servers} (default: @code{2})
  13802. How many worker processes should be started on start-up.
  13803. @item @code{min-spare-servers} (default: @code{1})
  13804. How many spare worker processes should be kept around at minimum.
  13805. @item @code{max-spare-servers} (default: @code{3})
  13806. How many spare worker processes should be kept around at maximum.
  13807. @end table
  13808. @end deftp
  13809. @deftp {Data type} php-fpm-static-process-manager-configuration
  13810. Data Type for the @code{static} php-fpm process manager. With the
  13811. @code{static} process manager, an unchanging number of worker processes are
  13812. created.
  13813. @table @asis
  13814. @item @code{max-children} (default: @code{5})
  13815. Maximum of worker processes.
  13816. @end table
  13817. @end deftp
  13818. @deftp {Data type} php-fpm-on-demand-process-manager-configuration
  13819. Data Type for the @code{on-demand} php-fpm process manager. With the
  13820. @code{on-demand} process manager, worker processes are only created as
  13821. requests arrive.
  13822. @table @asis
  13823. @item @code{max-children} (default: @code{5})
  13824. Maximum of worker processes.
  13825. @item @code{process-idle-timeout} (default: @code{10})
  13826. The time in seconds after which a process with no requests is killed.
  13827. @end table
  13828. @end deftp
  13829. @deffn {Scheme Procedure} nginx-php-fpm-location @
  13830. [#:nginx-package nginx] @ [socket (string-append "/var/run/php" @
  13831. (version-major (package-version php)) @ "-fpm.sock")] A helper function to
  13832. quickly add php to an @code{nginx-server-configuration}.
  13833. @end deffn
  13834. A simple services setup for nginx with php can look like this:
  13835. @example
  13836. (services (cons* (service dhcp-client-service-type)
  13837. (service php-fpm-service-type)
  13838. (service nginx-service-type
  13839. (nginx-server-configuration
  13840. (server-name '("example.com"))
  13841. (root "/srv/http/")
  13842. (locations
  13843. (list (nginx-php-location)))
  13844. (https-port #f)
  13845. (ssl-certificate #f)
  13846. (ssl-certificate-key #f)))
  13847. %base-services))
  13848. @end example
  13849. @cindex cat-avatar-generator
  13850. The cat avatar generator is a simple service to demonstrate the use of
  13851. php-fpm in @code{Nginx}. It is used to generate cat avatar from a seed, for
  13852. instance the hash of a user's email address.
  13853. @deffn {Scheme Procedure} cat-avatar-generator-serice @
  13854. [#:cache-dir "/var/cache/cat-avatar-generator"] @ [#:package
  13855. cat-avatar-generator] @ [#:configuration (nginx-server-configuration)]
  13856. Returns an nginx-server-configuration that inherits @code{configuration}.
  13857. It extends the nginx configuration to add a server block that serves
  13858. @code{package}, a version of cat-avatar-generator. During execution,
  13859. cat-avatar-generator will be able to use @code{cache-dir} as its cache
  13860. directory.
  13861. @end deffn
  13862. A simple setup for cat-avatar-generator can look like this:
  13863. @example
  13864. (services (cons* (cat-avatar-generator-service
  13865. #:configuration
  13866. (nginx-server-configuration
  13867. (server-name '("example.com"))))
  13868. ...
  13869. %base-services))
  13870. @end example
  13871. @subsubheading Hpcguix-web
  13872. @cindex hpcguix-web
  13873. The @uref{hpcguix-web, https://github.com/UMCUGenetics/hpcguix-web/} program
  13874. is a customizable web interface to browse Guix packages, initially designed
  13875. for users of high-performance computing (HPC) clusters.
  13876. @defvr {Scheme Variable} hpcguix-web-service-type
  13877. The service type for @code{hpcguix-web}.
  13878. @end defvr
  13879. @deftp {Data Type} hpcguix-web-configuration
  13880. Data type for the hpcguix-web service configuration.
  13881. @table @asis
  13882. @item @code{specs}
  13883. A gexp (@pxref{G-Ausdrücke}) specifying the hpcguix-web service
  13884. configuration. The main items available in this spec are:
  13885. @table @asis
  13886. @item @code{title-prefix} (default: @code{"hpcguix | "})
  13887. The page title prefix.
  13888. @item @code{guix-command} (default: @code{"guix"})
  13889. The @command{guix} command.
  13890. @item @code{package-filter-proc} (default: @code{(const #t)})
  13891. A procedure specifying how to filter packages that are displayed.
  13892. @item @code{package-page-extension-proc} (default: @code{(const '())})
  13893. Extension package for @code{hpcguix-web}.
  13894. @item @code{menu} (default: @code{'()})
  13895. Additional entry in page @code{menu}.
  13896. @item @code{channels} (default: @code{%default-channels})
  13897. List of channels from which the package list is built (@pxref{Channels}).
  13898. @item @code{package-list-expiration} (default: @code{(* 12 3600)})
  13899. The expiration time, in seconds, after which the package list is rebuilt
  13900. from the latest instances of the given channels.
  13901. @end table
  13902. See the hpcguix-web repository for a
  13903. @uref{https://github.com/UMCUGenetics/hpcguix-web/blob/master/hpcweb-configuration.scm,
  13904. complete example}.
  13905. @item @code{package} (default: @code{hpcguix-web})
  13906. The hpcguix-web package to use.
  13907. @end table
  13908. @end deftp
  13909. A typical hpcguix-web service declaration looks like this:
  13910. @example
  13911. (service hpcguix-web-service-type
  13912. (hpcguix-web-configuration
  13913. (specs
  13914. #~(define site-config
  13915. (hpcweb-configuration
  13916. (title-prefix "Guix-HPC - ")
  13917. (menu '(("/about" "ABOUT"))))))))
  13918. @end example
  13919. @quotation Anmerkung
  13920. The hpcguix-web service periodically updates the package list it publishes
  13921. by pulling channels from Git. To that end, it needs to access X.509
  13922. certificates so that it can authenticate Git servers when communicating over
  13923. HTTPS, and it assumes that @file{/etc/ssl/certs} contains those
  13924. certificates.
  13925. Thus, make sure to add @code{nss-certs} or another certificate package to
  13926. the @code{packages} field of your configuration. @ref{X.509-Zertifikate},
  13927. for more information on X.509 certificates.
  13928. @end quotation
  13929. @node Zertifikatsdienste
  13930. @subsubsection Zertifikatsdienste
  13931. @cindex Web
  13932. @cindex HTTP, HTTPS
  13933. @cindex Let's Encrypt
  13934. @cindex TLS certificates
  13935. The @code{(gnu services certbot)} module provides a service to automatically
  13936. obtain a valid TLS certificate from the Let's Encrypt certificate
  13937. authority. These certificates can then be used to serve content securely
  13938. over HTTPS or other TLS-based protocols, with the knowledge that the client
  13939. will be able to verify the server's authenticity.
  13940. @url{https://letsencrypt.org/, Let's Encrypt} provides the @code{certbot}
  13941. tool to automate the certification process. This tool first securely
  13942. generates a key on the server. It then makes a request to the Let's Encrypt
  13943. certificate authority (CA) to sign the key. The CA checks that the request
  13944. originates from the host in question by using a challenge-response protocol,
  13945. requiring the server to provide its response over HTTP. If that protocol
  13946. completes successfully, the CA signs the key, resulting in a certificate.
  13947. That certificate is valid for a limited period of time, and therefore to
  13948. continue to provide TLS services, the server needs to periodically ask the
  13949. CA to renew its signature.
  13950. The certbot service automates this process: the initial key generation, the
  13951. initial certification request to the Let's Encrypt service, the web server
  13952. challenge/response integration, writing the certificate to disk, the
  13953. automated periodic renewals, and the deployment tasks associated with the
  13954. renewal (e.g.@: reloading services, copying keys with different
  13955. permissions).
  13956. Certbot is run twice a day, at a random minute within the hour. It won't do
  13957. anything until your certificates are due for renewal or revoked, but running
  13958. it regularly would give your service a chance of staying online in case a
  13959. Let's Encrypt-initiated revocation happened for some reason.
  13960. By using this service, you agree to the ACME Subscriber Agreement, which can
  13961. be found there: @url{https://acme-v01.api.letsencrypt.org/directory}.
  13962. @defvr {Scheme Variable} certbot-service-type
  13963. A service type for the @code{certbot} Let's Encrypt client. Its value must
  13964. be a @code{certbot-configuration} record as in this example:
  13965. @example
  13966. (define %nginx-deploy-hook
  13967. (program-file
  13968. "nginx-deploy-hook"
  13969. #~(let ((pid (call-with-input-file "/var/run/nginx/pid" read)))
  13970. (kill pid SIGHUP))))
  13971. (service certbot-service-type
  13972. (certbot-configuration
  13973. (email "foo@@example.net")
  13974. (certificates
  13975. (list
  13976. (certificate-configuration
  13977. (domains '("example.net" "www.example.net"))
  13978. (deploy-hook %nginx-deploy-hook))
  13979. (certificate-configuration
  13980. (domains '("bar.example.net")))))))
  13981. @end example
  13982. See below for details about @code{certbot-configuration}.
  13983. @end defvr
  13984. @deftp {Data Type} certbot-configuration
  13985. Data type representing the configuration of the @code{certbot} service.
  13986. This type has the following parameters:
  13987. @table @asis
  13988. @item @code{package} (default: @code{certbot})
  13989. The certbot package to use.
  13990. @item @code{webroot} (default: @code{/var/www})
  13991. The directory from which to serve the Let's Encrypt challenge/response
  13992. files.
  13993. @item @code{certificates} (default: @code{()})
  13994. A list of @code{certificates-configuration}s for which to generate
  13995. certificates and request signatures. Each certificate has a @code{name} and
  13996. several @code{domains}.
  13997. @item @code{email}
  13998. Mandatory email used for registration, recovery contact, and important
  13999. account notifications.
  14000. @item @code{rsa-key-size} (default: @code{2048})
  14001. Size of the RSA key.
  14002. @item @code{default-location} (default: @i{see below})
  14003. The default @code{nginx-location-configuration}. Because @code{certbot}
  14004. needs to be able to serve challenges and responses, it needs to be able to
  14005. run a web server. It does so by extending the @code{nginx} web service with
  14006. an @code{nginx-server-configuration} listening on the @var{domains} on port
  14007. 80, and which has a @code{nginx-location-configuration} for the
  14008. @code{/.well-known/} URI path subspace used by Let's Encrypt. @xref{Web-Dienste}, for more on these nginx configuration data types.
  14009. Requests to other URL paths will be matched by the @code{default-location},
  14010. which if present is added to all @code{nginx-server-configuration}s.
  14011. By default, the @code{default-location} will issue a redirect from
  14012. @code{http://@var{domain}/...} to @code{https://@var{domain}/...}, leaving
  14013. you to define what to serve on your site via @code{https}.
  14014. Pass @code{#f} to not issue a default location.
  14015. @end table
  14016. @end deftp
  14017. @deftp {Data Type} certificate-configuration
  14018. Data type representing the configuration of a certificate. This type has
  14019. the following parameters:
  14020. @table @asis
  14021. @item @code{name} (default: @i{see below})
  14022. This name is used by Certbot for housekeeping and in file paths; it doesn't
  14023. affect the content of the certificate itself. To see certificate names, run
  14024. @code{certbot certificates}.
  14025. Its default is the first provided domain.
  14026. @item @code{domains} (default: @code{()})
  14027. The first domain provided will be the subject CN of the certificate, and all
  14028. domains will be Subject Alternative Names on the certificate.
  14029. @item @code{deploy-hook} (default: @code{#f})
  14030. Command to be run in a shell once for each successfully issued certificate.
  14031. For this command, the shell variable @code{$RENEWED_LINEAGE} will point to
  14032. the config live subdirectory (for example,
  14033. @samp{"/etc/letsencrypt/live/example.com"}) containing the new certificates
  14034. and keys; the shell variable @code{$RENEWED_DOMAINS} will contain a
  14035. space-delimited list of renewed certificate domains (for example,
  14036. @samp{"example.com www.example.com"}.
  14037. @end table
  14038. @end deftp
  14039. For each @code{certificate-configuration}, the certificate is saved to
  14040. @code{/etc/letsencrypt/live/@var{name}/fullchain.pem} and the key is saved
  14041. to @code{/etc/letsencrypt/live/@var{name}/privkey.pem}.
  14042. @node DNS-Dienste
  14043. @subsubsection DNS-Dienste
  14044. @cindex DNS (domain name system)
  14045. @cindex domain name system (DNS)
  14046. The @code{(gnu services dns)} module provides services related to the
  14047. @dfn{domain name system} (DNS). It provides a server service for hosting an
  14048. @emph{authoritative} DNS server for multiple zones, slave or master. This
  14049. service uses @uref{https://www.knot-dns.cz/, Knot DNS}. And also a caching
  14050. and forwarding DNS server for the LAN, which uses
  14051. @uref{http://www.thekelleys.org.uk/dnsmasq/doc.html, dnsmasq}.
  14052. @subsubheading Knot Service
  14053. An example configuration of an authoritative server for two zones, one
  14054. master and one slave, is:
  14055. @lisp
  14056. (define-zone-entries example.org.zone
  14057. ;; Name TTL Class Type Data
  14058. ("@@" "" "IN" "A" "127.0.0.1")
  14059. ("@@" "" "IN" "NS" "ns")
  14060. ("ns" "" "IN" "A" "127.0.0.1"))
  14061. (define master-zone
  14062. (knot-zone-configuration
  14063. (domain "example.org")
  14064. (zone (zone-file
  14065. (origin "example.org")
  14066. (entries example.org.zone)))))
  14067. (define slave-zone
  14068. (knot-zone-configuration
  14069. (domain "plop.org")
  14070. (dnssec-policy "default")
  14071. (master (list "plop-master"))))
  14072. (define plop-master
  14073. (knot-remote-configuration
  14074. (id "plop-master")
  14075. (address (list "208.76.58.171"))))
  14076. (operating-system
  14077. ;; ...
  14078. (services (cons* (service knot-service-type
  14079. (knot-configuration
  14080. (remotes (list plop-master))
  14081. (zones (list master-zone slave-zone))))
  14082. ;; ...
  14083. %base-services)))
  14084. @end lisp
  14085. @deffn {Scheme Variable} knot-service-type
  14086. This is the type for the Knot DNS server.
  14087. Knot DNS is an authoritative DNS server, meaning that it can serve multiple
  14088. zones, that is to say domain names you would buy from a registrar. This
  14089. server is not a resolver, meaning that it can only resolve names for which
  14090. it is authoritative. This server can be configured to serve zones as a
  14091. master server or a slave server as a per-zone basis. Slave zones will get
  14092. their data from masters, and will serve it as an authoritative server. From
  14093. the point of view of a resolver, there is no difference between master and
  14094. slave.
  14095. The following data types are used to configure the Knot DNS server:
  14096. @end deffn
  14097. @deftp {Data Type} knot-key-configuration
  14098. Data type representing a key. This type has the following parameters:
  14099. @table @asis
  14100. @item @code{id} (default: @code{""})
  14101. An identifier for other configuration fields to refer to this key. IDs must
  14102. be unique and must not be empty.
  14103. @item @code{algorithm} (default: @code{#f})
  14104. The algorithm to use. Choose between @code{#f}, @code{'hmac-md5},
  14105. @code{'hmac-sha1}, @code{'hmac-sha224}, @code{'hmac-sha256},
  14106. @code{'hmac-sha384} and @code{'hmac-sha512}.
  14107. @item @code{secret} (default: @code{""})
  14108. The secret key itself.
  14109. @end table
  14110. @end deftp
  14111. @deftp {Data Type} knot-acl-configuration
  14112. Data type representing an Access Control List (ACL) configuration. This
  14113. type has the following parameters:
  14114. @table @asis
  14115. @item @code{id} (default: @code{""})
  14116. An identifier for ether configuration fields to refer to this key. IDs must
  14117. be unique and must not be empty.
  14118. @item @code{address} (default: @code{'()})
  14119. An ordered list of IP addresses, network subnets, or network ranges
  14120. represented with strings. The query must match one of them. Empty value
  14121. means that address match is not required.
  14122. @item @code{key} (default: @code{'()})
  14123. An ordered list of references to keys represented with strings. The string
  14124. must match a key ID defined in a @code{knot-key-configuration}. No key
  14125. means that a key is not require to match that ACL.
  14126. @item @code{action} (default: @code{'()})
  14127. An ordered list of actions that are permitted or forbidden by this ACL.
  14128. Possible values are lists of zero or more elements from @code{'transfer},
  14129. @code{'notify} and @code{'update}.
  14130. @item @code{deny?} (default: @code{#f})
  14131. When true, the ACL defines restrictions. Listed actions are forbidden.
  14132. When false, listed actions are allowed.
  14133. @end table
  14134. @end deftp
  14135. @deftp {Data Type} zone-entry
  14136. Data type represnting a record entry in a zone file. This type has the
  14137. following parameters:
  14138. @table @asis
  14139. @item @code{name} (default: @code{"@@"})
  14140. The name of the record. @code{"@@"} refers to the origin of the zone.
  14141. Names are relative to the origin of the zone. For example, in the
  14142. @code{example.org} zone, @code{"ns.example.org"} actually refers to
  14143. @code{ns.example.org.example.org}. Names ending with a dot are absolute,
  14144. which means that @code{"ns.example.org."} refers to @code{ns.example.org}.
  14145. @item @code{ttl} (default: @code{""})
  14146. The Time-To-Live (TTL) of this record. If not set, the default TTL is used.
  14147. @item @code{class} (default: @code{"IN"})
  14148. The class of the record. Knot currently supports only @code{"IN"} and
  14149. partially @code{"CH"}.
  14150. @item @code{type} (default: @code{"A"})
  14151. The type of the record. Common types include A (IPv4 address), AAAA (IPv6
  14152. address), NS (Name Server) and MX (Mail eXchange). Many other types are
  14153. defined.
  14154. @item @code{data} (default: @code{""})
  14155. The data contained in the record. For instance an IP address associated
  14156. with an A record, or a domain name associated with an NS record. Remember
  14157. that domain names are relative to the origin unless they end with a dot.
  14158. @end table
  14159. @end deftp
  14160. @deftp {Data Type} zone-file
  14161. Data type representing the content of a zone file. This type has the
  14162. following parameters:
  14163. @table @asis
  14164. @item @code{entries} (default: @code{'()})
  14165. The list of entries. The SOA record is taken care of, so you don't need to
  14166. put it in the list of entries. This list should probably contain an entry
  14167. for your primary authoritative DNS server. Other than using a list of
  14168. entries directly, you can use @code{define-zone-entries} to define a object
  14169. containing the list of entries more easily, that you can later pass to the
  14170. @code{entries} field of the @code{zone-file}.
  14171. @item @code{origin} (default: @code{""})
  14172. The name of your zone. This parameter cannot be empty.
  14173. @item @code{ns} (default: @code{"ns"})
  14174. The domain of your primary authoritative DNS server. The name is relative
  14175. to the origin, unless it ends with a dot. It is mandatory that this primary
  14176. DNS server corresponds to an NS record in the zone and that it is associated
  14177. to an IP address in the list of entries.
  14178. @item @code{mail} (default: @code{"hostmaster"})
  14179. An email address people can contact you at, as the owner of the zone. This
  14180. is translated as @code{<mail>@@<origin>}.
  14181. @item @code{serial} (default: @code{1})
  14182. The serial number of the zone. As this is used to keep track of changes by
  14183. both slaves and resolvers, it is mandatory that it @emph{never} decreases.
  14184. Always increment it when you make a change in your zone.
  14185. @item @code{refresh} (default: @code{(* 2 24 3600)})
  14186. The frequency at which slaves will do a zone transfer. This value is a
  14187. number of seconds. It can be computed by multiplications or with
  14188. @code{(string->duration)}.
  14189. @item @code{retry} (default: @code{(* 15 60)})
  14190. The period after which a slave will retry to contact its master when it
  14191. fails to do so a first time.
  14192. @item @code{expiry} (default: @code{(* 14 24 3600)})
  14193. Default TTL of records. Existing records are considered correct for at most
  14194. this amount of time. After this period, resolvers will invalidate their
  14195. cache and check again that it still exists.
  14196. @item @code{nx} (default: @code{3600})
  14197. Default TTL of inexistant records. This delay is usually short because you
  14198. want your new domains to reach everyone quickly.
  14199. @end table
  14200. @end deftp
  14201. @deftp {Data Type} knot-remote-configuration
  14202. Data type representing a remote configuration. This type has the following
  14203. parameters:
  14204. @table @asis
  14205. @item @code{id} (default: @code{""})
  14206. An identifier for other configuration fields to refer to this remote. IDs
  14207. must be unique and must not be empty.
  14208. @item @code{address} (default: @code{'()})
  14209. An ordered list of destination IP addresses. Addresses are tried in
  14210. sequence. An optional port can be given with the @@ separator. For
  14211. instance: @code{(list "1.2.3.4" "2.3.4.5@@53")}. Default port is 53.
  14212. @item @code{via} (default: @code{'()})
  14213. An ordered list of source IP addresses. An empty list will have Knot choose
  14214. an appropriate source IP. An optional port can be given with the @@
  14215. separator. The default is to choose at random.
  14216. @item @code{key} (default: @code{#f})
  14217. A reference to a key, that is a string containing the identifier of a key
  14218. defined in a @code{knot-key-configuration} field.
  14219. @end table
  14220. @end deftp
  14221. @deftp {Data Type} knot-keystore-configuration
  14222. Data type representing a keystore to hold dnssec keys. This type has the
  14223. following parameters:
  14224. @table @asis
  14225. @item @code{id} (default: @code{""})
  14226. The id of the keystore. It must not be empty.
  14227. @item @code{backend} (default: @code{'pem})
  14228. The backend to store the keys in. Can be @code{'pem} or @code{'pkcs11}.
  14229. @item @code{config} (default: @code{"/var/lib/knot/keys/keys"})
  14230. The configuration string of the backend. An example for the PKCS#11 is:
  14231. @code{"pkcs11:token=knot;pin-value=1234
  14232. /gnu/store/.../lib/pkcs11/libsofthsm2.so"}. For the pem backend, the string
  14233. reprensents a path in the file system.
  14234. @end table
  14235. @end deftp
  14236. @deftp {Data Type} knot-policy-configuration
  14237. Data type representing a dnssec policy. Knot DNS is able to automatically
  14238. sign your zones. It can either generate and manage your keys automatically
  14239. or use keys that you generate.
  14240. Dnssec is usually implemented using two keys: a Key Signing Key (KSK) that
  14241. is used to sign the second, and a Zone Signing Key (ZSK) that is used to
  14242. sign the zone. In order to be trusted, the KSK needs to be present in the
  14243. parent zone (usually a top-level domain). If your registrar supports
  14244. dnssec, you will have to send them your KSK's hash so they can add a DS
  14245. record in their zone. This is not automated and need to be done each time
  14246. you change your KSK.
  14247. The policy also defines the lifetime of keys. Usually, ZSK can be changed
  14248. easily and use weaker cryptographic functions (they use lower parameters) in
  14249. order to sign records quickly, so they are changed often. The KSK however
  14250. requires manual interaction with the registrar, so they are changed less
  14251. often and use stronger parameters because they sign only one record.
  14252. This type has the following parameters:
  14253. @table @asis
  14254. @item @code{id} (default: @code{""})
  14255. The id of the policy. It must not be empty.
  14256. @item @code{keystore} (default: @code{"default"})
  14257. A reference to a keystore, that is a string containing the identifier of a
  14258. keystore defined in a @code{knot-keystore-configuration} field. The
  14259. @code{"default"} identifier means the default keystore (a kasp database that
  14260. was setup by this service).
  14261. @item @code{manual?} (default: @code{#f})
  14262. Whether the key management is manual or automatic.
  14263. @item @code{single-type-signing?} (default: @code{#f})
  14264. When @code{#t}, use the Single-Type Signing Scheme.
  14265. @item @code{algorithm} (default: @code{"ecdsap256sha256"})
  14266. An algorithm of signing keys and issued signatures.
  14267. @item @code{ksk-size} (default: @code{256})
  14268. The length of the KSK. Note that this value is correct for the default
  14269. algorithm, but would be unsecure for other algorithms.
  14270. @item @code{zsk-size} (default: @code{256})
  14271. The length of the ZSK. Note that this value is correct for the default
  14272. algorithm, but would be unsecure for other algorithms.
  14273. @item @code{dnskey-ttl} (default: @code{'default})
  14274. The TTL value for DNSKEY records added into zone apex. The special
  14275. @code{'default} value means same as the zone SOA TTL.
  14276. @item @code{zsk-lifetime} (default: @code{(* 30 24 3600)})
  14277. The period between ZSK publication and the next rollover initiation.
  14278. @item @code{propagation-delay} (default: @code{(* 24 3600)})
  14279. An extra delay added for each key rollover step. This value should be high
  14280. enough to cover propagation of data from the master server to all slaves.
  14281. @item @code{rrsig-lifetime} (default: @code{(* 14 24 3600)})
  14282. A validity period of newly issued signatures.
  14283. @item @code{rrsig-refresh} (default: @code{(* 7 24 3600)})
  14284. A period how long before a signature expiration the signature will be
  14285. refreshed.
  14286. @item @code{nsec3?} (default: @code{#f})
  14287. When @code{#t}, NSEC3 will be used instead of NSEC.
  14288. @item @code{nsec3-iterations} (default: @code{5})
  14289. The number of additional times the hashing is performed.
  14290. @item @code{nsec3-salt-length} (default: @code{8})
  14291. The length of a salt field in octets, which is appended to the original
  14292. owner name before hashing.
  14293. @item @code{nsec3-salt-lifetime} (default: @code{(* 30 24 3600)})
  14294. The validity period of newly issued salt field.
  14295. @end table
  14296. @end deftp
  14297. @deftp {Data Type} knot-zone-configuration
  14298. Data type representing a zone served by Knot. This type has the following
  14299. parameters:
  14300. @table @asis
  14301. @item @code{domain} (default: @code{""})
  14302. The domain served by this configuration. It must not be empty.
  14303. @item @code{file} (default: @code{""})
  14304. The file where this zone is saved. This parameter is ignored by master
  14305. zones. Empty means default location that depends on the domain name.
  14306. @item @code{zone} (default: @code{(zone-file)})
  14307. The content of the zone file. This parameter is ignored by slave zones. It
  14308. must contain a zone-file record.
  14309. @item @code{master} (default: @code{'()})
  14310. A list of master remotes. When empty, this zone is a master. When set,
  14311. this zone is a slave. This is a list of remotes identifiers.
  14312. @item @code{ddns-master} (default: @code{#f})
  14313. The main master. When empty, it defaults to the first master in the list of
  14314. masters.
  14315. @item @code{notify} (default: @code{'()})
  14316. A list of slave remote identifiers.
  14317. @item @code{acl} (default: @code{'()})
  14318. A list of acl identifiers.
  14319. @item @code{semantic-checks?} (default: @code{#f})
  14320. When set, this adds more semantic checks to the zone.
  14321. @item @code{disable-any?} (default: @code{#f})
  14322. When set, this forbids queries of the ANY type.
  14323. @item @code{zonefile-sync} (default: @code{0})
  14324. The delay between a modification in memory and on disk. 0 means immediate
  14325. synchronization.
  14326. @item @code{serial-policy} (default: @code{'increment})
  14327. A policy between @code{'increment} and @code{'unixtime}.
  14328. @end table
  14329. @end deftp
  14330. @deftp {Data Type} knot-configuration
  14331. Data type representing the Knot configuration. This type has the following
  14332. parameters:
  14333. @table @asis
  14334. @item @code{knot} (default: @code{knot})
  14335. The Knot package.
  14336. @item @code{run-directory} (default: @code{"/var/run/knot"})
  14337. The run directory. This directory will be used for pid file and sockets.
  14338. @item @code{listen-v4} (default: @code{"0.0.0.0"})
  14339. An ip address on which to listen.
  14340. @item @code{listen-v6} (default: @code{"::"})
  14341. An ip address on which to listen.
  14342. @item @code{listen-port} (default: @code{53})
  14343. A port on which to listen.
  14344. @item @code{keys} (default: @code{'()})
  14345. The list of knot-key-configuration used by this configuration.
  14346. @item @code{acls} (default: @code{'()})
  14347. The list of knot-acl-configuration used by this configuration.
  14348. @item @code{remotes} (default: @code{'()})
  14349. The list of knot-remote-configuration used by this configuration.
  14350. @item @code{zones} (default: @code{'()})
  14351. The list of knot-zone-configuration used by this configuration.
  14352. @end table
  14353. @end deftp
  14354. @subsubheading Dnsmasq Service
  14355. @deffn {Scheme Variable} dnsmasq-service-type
  14356. This is the type of the dnsmasq service, whose value should be an
  14357. @code{dnsmasq-configuration} object as in this example:
  14358. @example
  14359. (service dnsmasq-service-type
  14360. (dnsmasq-configuration
  14361. (no-resolv? #t)
  14362. (servers '("192.168.1.1"))))
  14363. @end example
  14364. @end deffn
  14365. @deftp {Data Type} dnsmasq-configuration
  14366. Data type representing the configuration of dnsmasq.
  14367. @table @asis
  14368. @item @code{package} (default: @var{dnsmasq})
  14369. Package object of the dnsmasq server.
  14370. @item @code{no-hosts?} (default: @code{#f})
  14371. When true, don't read the hostnames in /etc/hosts.
  14372. @item @code{port} (default: @code{53})
  14373. The port to listen on. Setting this to zero completely disables DNS
  14374. responses, leaving only DHCP and/or TFTP functions.
  14375. @item @code{local-service?} (default: @code{#t})
  14376. Accept DNS queries only from hosts whose address is on a local subnet, ie a
  14377. subnet for which an interface exists on the server.
  14378. @item @code{listen-addresses} (default: @code{'()})
  14379. Listen on the given IP addresses.
  14380. @item @code{resolv-file} (default: @code{"/etc/resolv.conf"})
  14381. The file to read the IP address of the upstream nameservers from.
  14382. @item @code{no-resolv?} (default: @code{#f})
  14383. When true, don't read @var{resolv-file}.
  14384. @item @code{servers} (default: @code{'()})
  14385. Specify IP address of upstream servers directly.
  14386. @item @code{cache-size} (default: @code{150})
  14387. Set the size of dnsmasq's cache. Setting the cache size to zero disables
  14388. caching.
  14389. @item @code{negative-cache?} (default: @code{#t})
  14390. When false, disable negative caching.
  14391. @end table
  14392. @end deftp
  14393. @subsubheading ddclient Service
  14394. @cindex ddclient
  14395. The ddclient service described below runs the ddclient daemon, which takes
  14396. care of automatically updating DNS entries for service providers such as
  14397. @uref{https://dyn.com/dns/, Dyn}.
  14398. The following example show instantiates the service with its default
  14399. configuration:
  14400. @example
  14401. (service ddclient-service-type)
  14402. @end example
  14403. Note that ddclient needs to access credentials that are stored in a
  14404. @dfn{secret file}, by default @file{/etc/ddclient/secrets} (see
  14405. @code{secret-file} below.) You are expected to create this file manually,
  14406. in an ``out-of-band'' fashion (you @emph{could} make this file part of the
  14407. service configuration, for instance by using @code{plain-file}, but it will
  14408. be world-readable @i{via} @file{/gnu/store}.) See the examples in the
  14409. @file{share/ddclient} directory of the @code{ddclient} package.
  14410. @c %start of fragment
  14411. Available @code{ddclient-configuration} fields are:
  14412. @deftypevr {@code{ddclient-configuration} parameter} package ddclient
  14413. The ddclient package.
  14414. @end deftypevr
  14415. @deftypevr {@code{ddclient-configuration} parameter} integer daemon
  14416. The period after which ddclient will retry to check IP and domain name.
  14417. Defaults to @samp{300}.
  14418. @end deftypevr
  14419. @deftypevr {@code{ddclient-configuration} parameter} boolean syslog
  14420. Use syslog for the output.
  14421. Defaults to @samp{#t}.
  14422. @end deftypevr
  14423. @deftypevr {@code{ddclient-configuration} parameter} string mail
  14424. Mail to user.
  14425. Defaults to @samp{"root"}.
  14426. @end deftypevr
  14427. @deftypevr {@code{ddclient-configuration} parameter} string mail-failure
  14428. Mail failed update to user.
  14429. Defaults to @samp{"root"}.
  14430. @end deftypevr
  14431. @deftypevr {@code{ddclient-configuration} parameter} string pid
  14432. The ddclient PID file.
  14433. Defaults to @samp{"/var/run/ddclient/ddclient.pid"}.
  14434. @end deftypevr
  14435. @deftypevr {@code{ddclient-configuration} parameter} boolean ssl
  14436. Enable SSL support.
  14437. Defaults to @samp{#t}.
  14438. @end deftypevr
  14439. @deftypevr {@code{ddclient-configuration} parameter} string user
  14440. Specifies the user name or ID that is used when running ddclient program.
  14441. Defaults to @samp{"ddclient"}.
  14442. @end deftypevr
  14443. @deftypevr {@code{ddclient-configuration} parameter} string group
  14444. Group of the user who will run the ddclient program.
  14445. Defaults to @samp{"ddclient"}.
  14446. @end deftypevr
  14447. @deftypevr {@code{ddclient-configuration} parameter} string secret-file
  14448. Secret file which will be appended to @file{ddclient.conf} file. This file
  14449. contains credentials for use by ddclient. You are expected to create it
  14450. manually.
  14451. Defaults to @samp{"/etc/ddclient/secrets.conf"}.
  14452. @end deftypevr
  14453. @deftypevr {@code{ddclient-configuration} parameter} list extra-options
  14454. Extra options will be appended to @file{ddclient.conf} file.
  14455. Defaults to @samp{()}.
  14456. @end deftypevr
  14457. @c %end of fragment
  14458. @node VPN-Dienste
  14459. @subsubsection VPN-Dienste
  14460. @cindex VPN (virtual private network)
  14461. @cindex virtual private network (VPN)
  14462. The @code{(gnu services vpn)} module provides services related to
  14463. @dfn{virtual private networks} (VPNs). It provides a @emph{client} service
  14464. for your machine to connect to a VPN, and a @emph{servire} service for your
  14465. machine to host a VPN. Both services use @uref{https://openvpn.net/,
  14466. OpenVPN}.
  14467. @deffn {Scheme Procedure} openvpn-client-service @
  14468. [#:config (openvpn-client-configuration)]
  14469. Return a service that runs @command{openvpn}, a VPN daemon, as a client.
  14470. @end deffn
  14471. @deffn {Scheme Procedure} openvpn-server-service @
  14472. [#:config (openvpn-server-configuration)]
  14473. Return a service that runs @command{openvpn}, a VPN daemon, as a server.
  14474. Both can be run simultaneously.
  14475. @end deffn
  14476. @c %automatically generated documentation
  14477. Available @code{openvpn-client-configuration} fields are:
  14478. @deftypevr {@code{openvpn-client-configuration} parameter} package openvpn
  14479. The OpenVPN package.
  14480. @end deftypevr
  14481. @deftypevr {@code{openvpn-client-configuration} parameter} string pid-file
  14482. The OpenVPN pid file.
  14483. Defaults to @samp{"/var/run/openvpn/openvpn.pid"}.
  14484. @end deftypevr
  14485. @deftypevr {@code{openvpn-client-configuration} parameter} proto proto
  14486. The protocol (UDP or TCP) used to open a channel between clients and
  14487. servers.
  14488. Defaults to @samp{udp}.
  14489. @end deftypevr
  14490. @deftypevr {@code{openvpn-client-configuration} parameter} dev dev
  14491. The device type used to represent the VPN connection.
  14492. Defaults to @samp{tun}.
  14493. @end deftypevr
  14494. @deftypevr {@code{openvpn-client-configuration} parameter} string ca
  14495. The certificate authority to check connections against.
  14496. Defaults to @samp{"/etc/openvpn/ca.crt"}.
  14497. @end deftypevr
  14498. @deftypevr {@code{openvpn-client-configuration} parameter} string cert
  14499. The certificate of the machine the daemon is running on. It should be
  14500. signed by the authority given in @code{ca}.
  14501. Defaults to @samp{"/etc/openvpn/client.crt"}.
  14502. @end deftypevr
  14503. @deftypevr {@code{openvpn-client-configuration} parameter} string key
  14504. The key of the machine the daemon is running on. It must be the key whose
  14505. certificate is @code{cert}.
  14506. Defaults to @samp{"/etc/openvpn/client.key"}.
  14507. @end deftypevr
  14508. @deftypevr {@code{openvpn-client-configuration} parameter} boolean comp-lzo?
  14509. Whether to use the lzo compression algorithm.
  14510. Defaults to @samp{#t}.
  14511. @end deftypevr
  14512. @deftypevr {@code{openvpn-client-configuration} parameter} boolean persist-key?
  14513. Don't re-read key files across SIGUSR1 or --ping-restart.
  14514. Defaults to @samp{#t}.
  14515. @end deftypevr
  14516. @deftypevr {@code{openvpn-client-configuration} parameter} boolean persist-tun?
  14517. Don't close and reopen TUN/TAP device or run up/down scripts across SIGUSR1
  14518. or --ping-restart restarts.
  14519. Defaults to @samp{#t}.
  14520. @end deftypevr
  14521. @deftypevr {@code{openvpn-client-configuration} parameter} number verbosity
  14522. Verbosity level.
  14523. Defaults to @samp{3}.
  14524. @end deftypevr
  14525. @deftypevr {@code{openvpn-client-configuration} parameter} tls-auth-client tls-auth
  14526. Add an additional layer of HMAC authentication on top of the TLS control
  14527. channel to protect against DoS attacks.
  14528. Defaults to @samp{#f}.
  14529. @end deftypevr
  14530. @deftypevr {@code{openvpn-client-configuration} parameter} key-usage verify-key-usage?
  14531. Whether to check the server certificate has server usage extension.
  14532. Defaults to @samp{#t}.
  14533. @end deftypevr
  14534. @deftypevr {@code{openvpn-client-configuration} parameter} bind bind?
  14535. Bind to a specific local port number.
  14536. Defaults to @samp{#f}.
  14537. @end deftypevr
  14538. @deftypevr {@code{openvpn-client-configuration} parameter} resolv-retry resolv-retry?
  14539. Retry resolving server address.
  14540. Defaults to @samp{#t}.
  14541. @end deftypevr
  14542. @deftypevr {@code{openvpn-client-configuration} parameter} openvpn-remote-list remote
  14543. A list of remote servers to connect to.
  14544. Defaults to @samp{()}.
  14545. Available @code{openvpn-remote-configuration} fields are:
  14546. @deftypevr {@code{openvpn-remote-configuration} parameter} string name
  14547. Server name.
  14548. Defaults to @samp{"my-server"}.
  14549. @end deftypevr
  14550. @deftypevr {@code{openvpn-remote-configuration} parameter} number port
  14551. Port number the server listens to.
  14552. Defaults to @samp{1194}.
  14553. @end deftypevr
  14554. @end deftypevr
  14555. @c %end of automatic openvpn-client documentation
  14556. @c %automatically generated documentation
  14557. Available @code{openvpn-server-configuration} fields are:
  14558. @deftypevr {@code{openvpn-server-configuration} parameter} package openvpn
  14559. The OpenVPN package.
  14560. @end deftypevr
  14561. @deftypevr {@code{openvpn-server-configuration} parameter} string pid-file
  14562. The OpenVPN pid file.
  14563. Defaults to @samp{"/var/run/openvpn/openvpn.pid"}.
  14564. @end deftypevr
  14565. @deftypevr {@code{openvpn-server-configuration} parameter} proto proto
  14566. The protocol (UDP or TCP) used to open a channel between clients and
  14567. servers.
  14568. Defaults to @samp{udp}.
  14569. @end deftypevr
  14570. @deftypevr {@code{openvpn-server-configuration} parameter} dev dev
  14571. The device type used to represent the VPN connection.
  14572. Defaults to @samp{tun}.
  14573. @end deftypevr
  14574. @deftypevr {@code{openvpn-server-configuration} parameter} string ca
  14575. The certificate authority to check connections against.
  14576. Defaults to @samp{"/etc/openvpn/ca.crt"}.
  14577. @end deftypevr
  14578. @deftypevr {@code{openvpn-server-configuration} parameter} string cert
  14579. The certificate of the machine the daemon is running on. It should be
  14580. signed by the authority given in @code{ca}.
  14581. Defaults to @samp{"/etc/openvpn/client.crt"}.
  14582. @end deftypevr
  14583. @deftypevr {@code{openvpn-server-configuration} parameter} string key
  14584. The key of the machine the daemon is running on. It must be the key whose
  14585. certificate is @code{cert}.
  14586. Defaults to @samp{"/etc/openvpn/client.key"}.
  14587. @end deftypevr
  14588. @deftypevr {@code{openvpn-server-configuration} parameter} boolean comp-lzo?
  14589. Whether to use the lzo compression algorithm.
  14590. Defaults to @samp{#t}.
  14591. @end deftypevr
  14592. @deftypevr {@code{openvpn-server-configuration} parameter} boolean persist-key?
  14593. Don't re-read key files across SIGUSR1 or --ping-restart.
  14594. Defaults to @samp{#t}.
  14595. @end deftypevr
  14596. @deftypevr {@code{openvpn-server-configuration} parameter} boolean persist-tun?
  14597. Don't close and reopen TUN/TAP device or run up/down scripts across SIGUSR1
  14598. or --ping-restart restarts.
  14599. Defaults to @samp{#t}.
  14600. @end deftypevr
  14601. @deftypevr {@code{openvpn-server-configuration} parameter} number verbosity
  14602. Verbosity level.
  14603. Defaults to @samp{3}.
  14604. @end deftypevr
  14605. @deftypevr {@code{openvpn-server-configuration} parameter} tls-auth-server tls-auth
  14606. Add an additional layer of HMAC authentication on top of the TLS control
  14607. channel to protect against DoS attacks.
  14608. Defaults to @samp{#f}.
  14609. @end deftypevr
  14610. @deftypevr {@code{openvpn-server-configuration} parameter} number port
  14611. Specifies the port number on which the server listens.
  14612. Defaults to @samp{1194}.
  14613. @end deftypevr
  14614. @deftypevr {@code{openvpn-server-configuration} parameter} ip-mask server
  14615. An ip and mask specifying the subnet inside the virtual network.
  14616. Defaults to @samp{"10.8.0.0 255.255.255.0"}.
  14617. @end deftypevr
  14618. @deftypevr {@code{openvpn-server-configuration} parameter} cidr6 server-ipv6
  14619. A CIDR notation specifying the IPv6 subnet inside the virtual network.
  14620. Defaults to @samp{#f}.
  14621. @end deftypevr
  14622. @deftypevr {@code{openvpn-server-configuration} parameter} string dh
  14623. The Diffie-Hellman parameters file.
  14624. Defaults to @samp{"/etc/openvpn/dh2048.pem"}.
  14625. @end deftypevr
  14626. @deftypevr {@code{openvpn-server-configuration} parameter} string ifconfig-pool-persist
  14627. The file that records client IPs.
  14628. Defaults to @samp{"/etc/openvpn/ipp.txt"}.
  14629. @end deftypevr
  14630. @deftypevr {@code{openvpn-server-configuration} parameter} gateway redirect-gateway?
  14631. When true, the server will act as a gateway for its clients.
  14632. Defaults to @samp{#f}.
  14633. @end deftypevr
  14634. @deftypevr {@code{openvpn-server-configuration} parameter} boolean client-to-client?
  14635. When true, clients are allowed to talk to each other inside the VPN.
  14636. Defaults to @samp{#f}.
  14637. @end deftypevr
  14638. @deftypevr {@code{openvpn-server-configuration} parameter} keepalive keepalive
  14639. Causes ping-like messages to be sent back and forth over the link so that
  14640. each side knows when the other side has gone down. @code{keepalive}
  14641. requires a pair. The first element is the period of the ping sending, and
  14642. the second element is the timeout before considering the other side down.
  14643. @end deftypevr
  14644. @deftypevr {@code{openvpn-server-configuration} parameter} number max-clients
  14645. The maximum number of clients.
  14646. Defaults to @samp{100}.
  14647. @end deftypevr
  14648. @deftypevr {@code{openvpn-server-configuration} parameter} string status
  14649. The status file. This file shows a small report on current connection. It
  14650. is truncated and rewritten every minute.
  14651. Defaults to @samp{"/var/run/openvpn/status"}.
  14652. @end deftypevr
  14653. @deftypevr {@code{openvpn-server-configuration} parameter} openvpn-ccd-list client-config-dir
  14654. The list of configuration for some clients.
  14655. Defaults to @samp{()}.
  14656. Available @code{openvpn-ccd-configuration} fields are:
  14657. @deftypevr {@code{openvpn-ccd-configuration} parameter} string name
  14658. Client name.
  14659. Defaults to @samp{"client"}.
  14660. @end deftypevr
  14661. @deftypevr {@code{openvpn-ccd-configuration} parameter} ip-mask iroute
  14662. Client own network
  14663. Defaults to @samp{#f}.
  14664. @end deftypevr
  14665. @deftypevr {@code{openvpn-ccd-configuration} parameter} ip-mask ifconfig-push
  14666. Client VPN IP.
  14667. Defaults to @samp{#f}.
  14668. @end deftypevr
  14669. @end deftypevr
  14670. @c %end of automatic openvpn-server documentation
  14671. @node Network File System
  14672. @subsubsection Network File System
  14673. @cindex NFS
  14674. The @code{(gnu services nfs)} module provides the following services, which
  14675. are most commonly used in relation to mounting or exporting directory trees
  14676. as @dfn{network file systems} (NFS).
  14677. @subsubheading RPC Bind Service
  14678. @cindex rpcbind
  14679. The RPC Bind service provides a facility to map program numbers into
  14680. universal addresses. Many NFS related services use this facility. Hence it
  14681. is automatically started when a dependent service starts.
  14682. @defvr {Scheme Variable} rpcbind-service-type
  14683. A service type for the RPC portmapper daemon.
  14684. @end defvr
  14685. @deftp {Data Type} rpcbind-configuration
  14686. Data type representing the configuration of the RPC Bind Service. This type
  14687. has the following parameters:
  14688. @table @asis
  14689. @item @code{rpcbind} (default: @code{rpcbind})
  14690. The rpcbind package to use.
  14691. @item @code{warm-start?} (default: @code{#t})
  14692. If this parameter is @code{#t}, then the daemon will read a state file on
  14693. startup thus reloading state information saved by a previous instance.
  14694. @end table
  14695. @end deftp
  14696. @subsubheading Pipefs Pseudo File System
  14697. @cindex pipefs
  14698. @cindex rpc_pipefs
  14699. The pipefs file system is used to transfer NFS related data between the
  14700. kernel and user space programs.
  14701. @defvr {Scheme Variable} pipefs-service-type
  14702. A service type for the pipefs pseudo file system.
  14703. @end defvr
  14704. @deftp {Data Type} pipefs-configuration
  14705. Data type representing the configuration of the pipefs pseudo file system
  14706. service. This type has the following parameters:
  14707. @table @asis
  14708. @item @code{mount-point} (default: @code{"/var/lib/nfs/rpc_pipefs"})
  14709. The directory to which the file system is to be attached.
  14710. @end table
  14711. @end deftp
  14712. @subsubheading GSS Daemon Service
  14713. @cindex GSSD
  14714. @cindex GSS
  14715. @cindex global security system
  14716. The @dfn{global security system} (GSS) daemon provides strong security for
  14717. RPC based protocols. Before exchanging RPC requests an RPC client must
  14718. establish a security context. Typically this is done using the Kerberos
  14719. command @command{kinit} or automatically at login time using PAM services
  14720. (@pxref{Kerberos-Dienste}).
  14721. @defvr {Scheme Variable} gss-service-type
  14722. A service type for the Global Security System (GSS) daemon.
  14723. @end defvr
  14724. @deftp {Data Type} gss-configuration
  14725. Data type representing the configuration of the GSS daemon service. This
  14726. type has the following parameters:
  14727. @table @asis
  14728. @item @code{nfs-utils} (default: @code{nfs-utils})
  14729. The package in which the @command{rpc.gssd} command is to be found.
  14730. @item @code{pipefs-directory} (default: @code{"/var/lib/nfs/rpc_pipefs"})
  14731. The directory where the pipefs file system is mounted.
  14732. @end table
  14733. @end deftp
  14734. @subsubheading IDMAP Daemon Service
  14735. @cindex idmapd
  14736. @cindex name mapper
  14737. The idmap daemon service provides mapping between user IDs and user names.
  14738. Typically it is required in order to access file systems mounted via NFSv4.
  14739. @defvr {Scheme Variable} idmap-service-type
  14740. A service type for the Identity Mapper (IDMAP) daemon.
  14741. @end defvr
  14742. @deftp {Data Type} idmap-configuration
  14743. Data type representing the configuration of the IDMAP daemon service. This
  14744. type has the following parameters:
  14745. @table @asis
  14746. @item @code{nfs-utils} (default: @code{nfs-utils})
  14747. The package in which the @command{rpc.idmapd} command is to be found.
  14748. @item @code{pipefs-directory} (default: @code{"/var/lib/nfs/rpc_pipefs"})
  14749. The directory where the pipefs file system is mounted.
  14750. @item @code{domain} (default: @code{#f})
  14751. The local NFSv4 domain name. This must be a string or @code{#f}. If it is
  14752. @code{#f} then the daemon will use the host's fully qualified domain name.
  14753. @end table
  14754. @end deftp
  14755. @node Kontinuierliche Integration
  14756. @subsubsection Kontinuierliche Integration
  14757. @cindex continuous integration
  14758. @uref{https://git.savannah.gnu.org/cgit/guix/guix-cuirass.git, Cuirass} is a
  14759. continuous integration tool for Guix. It can be used both for development
  14760. and for providing substitutes to others (@pxref{Substitute}).
  14761. The @code{(gnu services cuirass)} module provides the following service.
  14762. @defvr {Scheme Procedure} cuirass-service-type
  14763. The type of the Cuirass service. Its value must be a
  14764. @code{cuirass-configuration} object, as described below.
  14765. @end defvr
  14766. To add build jobs, you have to set the @code{specifications} field of the
  14767. configuration. Here is an example of a service that polls the Guix
  14768. repository and builds the packages from a manifest. Some of the packages
  14769. are defined in the @code{"custom-packages"} input, which is the equivalent
  14770. of @code{GUIX_PACKAGE_PATH}.
  14771. @example
  14772. (define %cuirass-specs
  14773. #~(list
  14774. '((#:name . "my-manifest")
  14775. (#:load-path-inputs . ("guix"))
  14776. (#:package-path-inputs . ("custom-packages"))
  14777. (#:proc-input . "guix")
  14778. (#:proc-file . "build-aux/cuirass/gnu-system.scm")
  14779. (#:proc . cuirass-jobs)
  14780. (#:proc-args . ((subset . "manifests")
  14781. (systems . ("x86_64-linux"))
  14782. (manifests . (("config" . "guix/manifest.scm")))))
  14783. (#:inputs . (((#:name . "guix")
  14784. (#:url . "git://git.savannah.gnu.org/guix.git")
  14785. (#:load-path . ".")
  14786. (#:branch . "master")
  14787. (#:no-compile? . #t))
  14788. ((#:name . "config")
  14789. (#:url . "git://git.example.org/config.git")
  14790. (#:load-path . ".")
  14791. (#:branch . "master")
  14792. (#:no-compile? . #t))
  14793. ((#:name . "custom-packages")
  14794. (#:url . "git://git.example.org/custom-packages.git")
  14795. (#:load-path . ".")
  14796. (#:branch . "master")
  14797. (#:no-compile? . #t)))))))
  14798. (service cuirass-service-type
  14799. (cuirass-configuration
  14800. (specifications %cuirass-specs)))
  14801. @end example
  14802. While information related to build jobs is located directly in the
  14803. specifications, global settings for the @command{cuirass} process are
  14804. accessible in other @code{cuirass-configuration} fields.
  14805. @deftp {Data Type} cuirass-configuration
  14806. Data type representing the configuration of Cuirass.
  14807. @table @asis
  14808. @item @code{log-file} (default: @code{"/var/log/cuirass.log"})
  14809. Location of the log file.
  14810. @item @code{cache-directory} (default: @code{"/var/cache/cuirass"})
  14811. Location of the repository cache.
  14812. @item @code{user} (default: @code{"cuirass"})
  14813. Owner of the @code{cuirass} process.
  14814. @item @code{group} (default: @code{"cuirass"})
  14815. Owner's group of the @code{cuirass} process.
  14816. @item @code{interval} (default: @code{60})
  14817. Number of seconds between the poll of the repositories followed by the
  14818. Cuirass jobs.
  14819. @item @code{database} (default: @code{"/var/lib/cuirass/cuirass.db"})
  14820. Location of sqlite database which contains the build results and previously
  14821. added specifications.
  14822. @item @code{ttl} (default: @code{(* 30 24 3600)})
  14823. Specifies the time-to-live (TTL) in seconds of garbage collector roots that
  14824. are registered for build results. This means that build results are
  14825. protected from garbage collection for at least @var{ttl} seconds.
  14826. @item @code{port} (default: @code{8081})
  14827. Port number used by the HTTP server.
  14828. @item --listen=@var{host}
  14829. Listen on the network interface for @var{host}. The default is to accept
  14830. connections from localhost.
  14831. @item @code{specifications} (default: @code{#~'()})
  14832. A gexp (@pxref{G-Ausdrücke}) that evaluates to a list of specifications,
  14833. where a specification is an association list (@pxref{Associations Lists,,,
  14834. guile, GNU Guile Reference Manual}) whose keys are keywords
  14835. (@code{#:keyword-example}) as shown in the example above.
  14836. @item @code{use-substitutes?} (default: @code{#f})
  14837. This allows using substitutes to avoid building every dependencies of a job
  14838. from source.
  14839. @item @code{one-shot?} (default: @code{#f})
  14840. Only evaluate specifications and build derivations once.
  14841. @item @code{fallback?} (default: @code{#f})
  14842. When substituting a pre-built binary fails, fall back to building packages
  14843. locally.
  14844. @item @code{cuirass} (default: @code{cuirass})
  14845. The Cuirass package to use.
  14846. @end table
  14847. @end deftp
  14848. @node Power Management Services
  14849. @subsubsection Power Management Services
  14850. @cindex tlp
  14851. @cindex power management with TLP
  14852. @subsubheading TLP daemon
  14853. The @code{(gnu services pm)} module provides a Guix service definition for
  14854. the Linux power management tool TLP.
  14855. TLP enables various powersaving modes in userspace and kernel. Contrary to
  14856. @code{upower-service}, it is not a passive, monitoring tool, as it will
  14857. apply custom settings each time a new power source is detected. More
  14858. information can be found at @uref{http://linrunner.de/en/tlp/tlp.html, TLP
  14859. home page}.
  14860. @deffn {Scheme Variable} tlp-service-type
  14861. The service type for the TLP tool. Its value should be a valid TLP
  14862. configuration (see below). To use the default settings, simply write:
  14863. @example
  14864. (service tlp-service-type)
  14865. @end example
  14866. @end deffn
  14867. By default TLP does not need much configuration but most TLP parameters can
  14868. be tweaked using @code{tlp-configuration}.
  14869. Each parameter definition is preceded by its type; for example,
  14870. @samp{boolean foo} indicates that the @code{foo} parameter should be
  14871. specified as a boolean. Types starting with @code{maybe-} denote parameters
  14872. that won't show up in TLP config file when their value is @code{'disabled}.
  14873. @c The following documentation was initially generated by
  14874. @c (generate-tlp-documentation) in (gnu services pm). Manually maintained
  14875. @c documentation is better, so we shouldn't hesitate to edit below as
  14876. @c needed. However if the change you want to make to this documentation
  14877. @c can be done in an automated way, it's probably easier to change
  14878. @c (generate-documentation) than to make it below and have to deal with
  14879. @c the churn as TLP updates.
  14880. Available @code{tlp-configuration} fields are:
  14881. @deftypevr {@code{tlp-configuration} parameter} package tlp
  14882. The TLP package.
  14883. @end deftypevr
  14884. @deftypevr {@code{tlp-configuration} parameter} boolean tlp-enable?
  14885. Set to true if you wish to enable TLP.
  14886. Defaults to @samp{#t}.
  14887. @end deftypevr
  14888. @deftypevr {@code{tlp-configuration} parameter} string tlp-default-mode
  14889. Default mode when no power supply can be detected. Alternatives are AC and
  14890. BAT.
  14891. Defaults to @samp{"AC"}.
  14892. @end deftypevr
  14893. @deftypevr {@code{tlp-configuration} parameter} non-negative-integer disk-idle-secs-on-ac
  14894. Number of seconds Linux kernel has to wait after the disk goes idle, before
  14895. syncing on AC.
  14896. Defaults to @samp{0}.
  14897. @end deftypevr
  14898. @deftypevr {@code{tlp-configuration} parameter} non-negative-integer disk-idle-secs-on-bat
  14899. Same as @code{disk-idle-ac} but on BAT mode.
  14900. Defaults to @samp{2}.
  14901. @end deftypevr
  14902. @deftypevr {@code{tlp-configuration} parameter} non-negative-integer max-lost-work-secs-on-ac
  14903. Dirty pages flushing periodicity, expressed in seconds.
  14904. Defaults to @samp{15}.
  14905. @end deftypevr
  14906. @deftypevr {@code{tlp-configuration} parameter} non-negative-integer max-lost-work-secs-on-bat
  14907. Same as @code{max-lost-work-secs-on-ac} but on BAT mode.
  14908. Defaults to @samp{60}.
  14909. @end deftypevr
  14910. @deftypevr {@code{tlp-configuration} parameter} maybe-space-separated-string-list cpu-scaling-governor-on-ac
  14911. CPU frequency scaling governor on AC mode. With intel_pstate driver,
  14912. alternatives are powersave and performance. With acpi-cpufreq driver,
  14913. alternatives are ondemand, powersave, performance and conservative.
  14914. Defaults to @samp{disabled}.
  14915. @end deftypevr
  14916. @deftypevr {@code{tlp-configuration} parameter} maybe-space-separated-string-list cpu-scaling-governor-on-bat
  14917. Same as @code{cpu-scaling-governor-on-ac} but on BAT mode.
  14918. Defaults to @samp{disabled}.
  14919. @end deftypevr
  14920. @deftypevr {@code{tlp-configuration} parameter} maybe-non-negative-integer cpu-scaling-min-freq-on-ac
  14921. Set the min available frequency for the scaling governor on AC.
  14922. Defaults to @samp{disabled}.
  14923. @end deftypevr
  14924. @deftypevr {@code{tlp-configuration} parameter} maybe-non-negative-integer cpu-scaling-max-freq-on-ac
  14925. Set the max available frequency for the scaling governor on AC.
  14926. Defaults to @samp{disabled}.
  14927. @end deftypevr
  14928. @deftypevr {@code{tlp-configuration} parameter} maybe-non-negative-integer cpu-scaling-min-freq-on-bat
  14929. Set the min available frequency for the scaling governor on BAT.
  14930. Defaults to @samp{disabled}.
  14931. @end deftypevr
  14932. @deftypevr {@code{tlp-configuration} parameter} maybe-non-negative-integer cpu-scaling-max-freq-on-bat
  14933. Set the max available frequency for the scaling governor on BAT.
  14934. Defaults to @samp{disabled}.
  14935. @end deftypevr
  14936. @deftypevr {@code{tlp-configuration} parameter} maybe-non-negative-integer cpu-min-perf-on-ac
  14937. Limit the min P-state to control the power dissipation of the CPU, in AC
  14938. mode. Values are stated as a percentage of the available performance.
  14939. Defaults to @samp{disabled}.
  14940. @end deftypevr
  14941. @deftypevr {@code{tlp-configuration} parameter} maybe-non-negative-integer cpu-max-perf-on-ac
  14942. Limit the max P-state to control the power dissipation of the CPU, in AC
  14943. mode. Values are stated as a percentage of the available performance.
  14944. Defaults to @samp{disabled}.
  14945. @end deftypevr
  14946. @deftypevr {@code{tlp-configuration} parameter} maybe-non-negative-integer cpu-min-perf-on-bat
  14947. Same as @code{cpu-min-perf-on-ac} on BAT mode.
  14948. Defaults to @samp{disabled}.
  14949. @end deftypevr
  14950. @deftypevr {@code{tlp-configuration} parameter} maybe-non-negative-integer cpu-max-perf-on-bat
  14951. Same as @code{cpu-max-perf-on-ac} on BAT mode.
  14952. Defaults to @samp{disabled}.
  14953. @end deftypevr
  14954. @deftypevr {@code{tlp-configuration} parameter} maybe-boolean cpu-boost-on-ac?
  14955. Enable CPU turbo boost feature on AC mode.
  14956. Defaults to @samp{disabled}.
  14957. @end deftypevr
  14958. @deftypevr {@code{tlp-configuration} parameter} maybe-boolean cpu-boost-on-bat?
  14959. Same as @code{cpu-boost-on-ac?} on BAT mode.
  14960. Defaults to @samp{disabled}.
  14961. @end deftypevr
  14962. @deftypevr {@code{tlp-configuration} parameter} boolean sched-powersave-on-ac?
  14963. Allow Linux kernel to minimize the number of CPU cores/hyper-threads used
  14964. under light load conditions.
  14965. Defaults to @samp{#f}.
  14966. @end deftypevr
  14967. @deftypevr {@code{tlp-configuration} parameter} boolean sched-powersave-on-bat?
  14968. Same as @code{sched-powersave-on-ac?} but on BAT mode.
  14969. Defaults to @samp{#t}.
  14970. @end deftypevr
  14971. @deftypevr {@code{tlp-configuration} parameter} boolean nmi-watchdog?
  14972. Enable Linux kernel NMI watchdog.
  14973. Defaults to @samp{#f}.
  14974. @end deftypevr
  14975. @deftypevr {@code{tlp-configuration} parameter} maybe-string phc-controls
  14976. For Linux kernels with PHC patch applied, change CPU voltages. An example
  14977. value would be @samp{"F:V F:V F:V F:V"}.
  14978. Defaults to @samp{disabled}.
  14979. @end deftypevr
  14980. @deftypevr {@code{tlp-configuration} parameter} string energy-perf-policy-on-ac
  14981. Set CPU performance versus energy saving policy on AC. Alternatives are
  14982. performance, normal, powersave.
  14983. Defaults to @samp{"performance"}.
  14984. @end deftypevr
  14985. @deftypevr {@code{tlp-configuration} parameter} string energy-perf-policy-on-bat
  14986. Same as @code{energy-perf-policy-ac} but on BAT mode.
  14987. Defaults to @samp{"powersave"}.
  14988. @end deftypevr
  14989. @deftypevr {@code{tlp-configuration} parameter} space-separated-string-list disks-devices
  14990. Hard disk devices.
  14991. @end deftypevr
  14992. @deftypevr {@code{tlp-configuration} parameter} space-separated-string-list disk-apm-level-on-ac
  14993. Hard disk advanced power management level.
  14994. @end deftypevr
  14995. @deftypevr {@code{tlp-configuration} parameter} space-separated-string-list disk-apm-level-on-bat
  14996. Same as @code{disk-apm-bat} but on BAT mode.
  14997. @end deftypevr
  14998. @deftypevr {@code{tlp-configuration} parameter} maybe-space-separated-string-list disk-spindown-timeout-on-ac
  14999. Hard disk spin down timeout. One value has to be specified for each
  15000. declared hard disk.
  15001. Defaults to @samp{disabled}.
  15002. @end deftypevr
  15003. @deftypevr {@code{tlp-configuration} parameter} maybe-space-separated-string-list disk-spindown-timeout-on-bat
  15004. Same as @code{disk-spindown-timeout-on-ac} but on BAT mode.
  15005. Defaults to @samp{disabled}.
  15006. @end deftypevr
  15007. @deftypevr {@code{tlp-configuration} parameter} maybe-space-separated-string-list disk-iosched
  15008. Select IO scheduler for disk devices. One value has to be specified for
  15009. each declared hard disk. Example alternatives are cfq, deadline and noop.
  15010. Defaults to @samp{disabled}.
  15011. @end deftypevr
  15012. @deftypevr {@code{tlp-configuration} parameter} string sata-linkpwr-on-ac
  15013. SATA aggressive link power management (ALPM) level. Alternatives are
  15014. min_power, medium_power, max_performance.
  15015. Defaults to @samp{"max_performance"}.
  15016. @end deftypevr
  15017. @deftypevr {@code{tlp-configuration} parameter} string sata-linkpwr-on-bat
  15018. Same as @code{sata-linkpwr-ac} but on BAT mode.
  15019. Defaults to @samp{"min_power"}.
  15020. @end deftypevr
  15021. @deftypevr {@code{tlp-configuration} parameter} maybe-string sata-linkpwr-blacklist
  15022. Exclude specified SATA host devices for link power management.
  15023. Defaults to @samp{disabled}.
  15024. @end deftypevr
  15025. @deftypevr {@code{tlp-configuration} parameter} maybe-on-off-boolean ahci-runtime-pm-on-ac?
  15026. Enable Runtime Power Management for AHCI controller and disks on AC mode.
  15027. Defaults to @samp{disabled}.
  15028. @end deftypevr
  15029. @deftypevr {@code{tlp-configuration} parameter} maybe-on-off-boolean ahci-runtime-pm-on-bat?
  15030. Same as @code{ahci-runtime-pm-on-ac} on BAT mode.
  15031. Defaults to @samp{disabled}.
  15032. @end deftypevr
  15033. @deftypevr {@code{tlp-configuration} parameter} non-negative-integer ahci-runtime-pm-timeout
  15034. Seconds of inactivity before disk is suspended.
  15035. Defaults to @samp{15}.
  15036. @end deftypevr
  15037. @deftypevr {@code{tlp-configuration} parameter} string pcie-aspm-on-ac
  15038. PCI Express Active State Power Management level. Alternatives are default,
  15039. performance, powersave.
  15040. Defaults to @samp{"performance"}.
  15041. @end deftypevr
  15042. @deftypevr {@code{tlp-configuration} parameter} string pcie-aspm-on-bat
  15043. Same as @code{pcie-aspm-ac} but on BAT mode.
  15044. Defaults to @samp{"powersave"}.
  15045. @end deftypevr
  15046. @deftypevr {@code{tlp-configuration} parameter} string radeon-power-profile-on-ac
  15047. Radeon graphics clock speed level. Alternatives are low, mid, high, auto,
  15048. default.
  15049. Defaults to @samp{"high"}.
  15050. @end deftypevr
  15051. @deftypevr {@code{tlp-configuration} parameter} string radeon-power-profile-on-bat
  15052. Same as @code{radeon-power-ac} but on BAT mode.
  15053. Defaults to @samp{"low"}.
  15054. @end deftypevr
  15055. @deftypevr {@code{tlp-configuration} parameter} string radeon-dpm-state-on-ac
  15056. Radeon dynamic power management method (DPM). Alternatives are battery,
  15057. performance.
  15058. Defaults to @samp{"performance"}.
  15059. @end deftypevr
  15060. @deftypevr {@code{tlp-configuration} parameter} string radeon-dpm-state-on-bat
  15061. Same as @code{radeon-dpm-state-ac} but on BAT mode.
  15062. Defaults to @samp{"battery"}.
  15063. @end deftypevr
  15064. @deftypevr {@code{tlp-configuration} parameter} string radeon-dpm-perf-level-on-ac
  15065. Radeon DPM performance level. Alternatives are auto, low, high.
  15066. Defaults to @samp{"auto"}.
  15067. @end deftypevr
  15068. @deftypevr {@code{tlp-configuration} parameter} string radeon-dpm-perf-level-on-bat
  15069. Same as @code{radeon-dpm-perf-ac} but on BAT mode.
  15070. Defaults to @samp{"auto"}.
  15071. @end deftypevr
  15072. @deftypevr {@code{tlp-configuration} parameter} on-off-boolean wifi-pwr-on-ac?
  15073. Wifi power saving mode.
  15074. Defaults to @samp{#f}.
  15075. @end deftypevr
  15076. @deftypevr {@code{tlp-configuration} parameter} on-off-boolean wifi-pwr-on-bat?
  15077. Same as @code{wifi-power-ac?} but on BAT mode.
  15078. Defaults to @samp{#t}.
  15079. @end deftypevr
  15080. @deftypevr {@code{tlp-configuration} parameter} y-n-boolean wol-disable?
  15081. Disable wake on LAN.
  15082. Defaults to @samp{#t}.
  15083. @end deftypevr
  15084. @deftypevr {@code{tlp-configuration} parameter} non-negative-integer sound-power-save-on-ac
  15085. Timeout duration in seconds before activating audio power saving on Intel
  15086. HDA and AC97 devices. A value of 0 disables power saving.
  15087. Defaults to @samp{0}.
  15088. @end deftypevr
  15089. @deftypevr {@code{tlp-configuration} parameter} non-negative-integer sound-power-save-on-bat
  15090. Same as @code{sound-powersave-ac} but on BAT mode.
  15091. Defaults to @samp{1}.
  15092. @end deftypevr
  15093. @deftypevr {@code{tlp-configuration} parameter} y-n-boolean sound-power-save-controller?
  15094. Disable controller in powersaving mode on Intel HDA devices.
  15095. Defaults to @samp{#t}.
  15096. @end deftypevr
  15097. @deftypevr {@code{tlp-configuration} parameter} boolean bay-poweroff-on-bat?
  15098. Enable optical drive in UltraBay/MediaBay on BAT mode. Drive can be powered
  15099. on again by releasing (and reinserting) the eject lever or by pressing the
  15100. disc eject button on newer models.
  15101. Defaults to @samp{#f}.
  15102. @end deftypevr
  15103. @deftypevr {@code{tlp-configuration} parameter} string bay-device
  15104. Name of the optical drive device to power off.
  15105. Defaults to @samp{"sr0"}.
  15106. @end deftypevr
  15107. @deftypevr {@code{tlp-configuration} parameter} string runtime-pm-on-ac
  15108. Runtime Power Management for PCI(e) bus devices. Alternatives are on and
  15109. auto.
  15110. Defaults to @samp{"on"}.
  15111. @end deftypevr
  15112. @deftypevr {@code{tlp-configuration} parameter} string runtime-pm-on-bat
  15113. Same as @code{runtime-pm-ac} but on BAT mode.
  15114. Defaults to @samp{"auto"}.
  15115. @end deftypevr
  15116. @deftypevr {@code{tlp-configuration} parameter} boolean runtime-pm-all?
  15117. Runtime Power Management for all PCI(e) bus devices, except blacklisted
  15118. ones.
  15119. Defaults to @samp{#t}.
  15120. @end deftypevr
  15121. @deftypevr {@code{tlp-configuration} parameter} maybe-space-separated-string-list runtime-pm-blacklist
  15122. Exclude specified PCI(e) device addresses from Runtime Power Management.
  15123. Defaults to @samp{disabled}.
  15124. @end deftypevr
  15125. @deftypevr {@code{tlp-configuration} parameter} space-separated-string-list runtime-pm-driver-blacklist
  15126. Exclude PCI(e) devices assigned to the specified drivers from Runtime Power
  15127. Management.
  15128. @end deftypevr
  15129. @deftypevr {@code{tlp-configuration} parameter} boolean usb-autosuspend?
  15130. Enable USB autosuspend feature.
  15131. Defaults to @samp{#t}.
  15132. @end deftypevr
  15133. @deftypevr {@code{tlp-configuration} parameter} maybe-string usb-blacklist
  15134. Exclude specified devices from USB autosuspend.
  15135. Defaults to @samp{disabled}.
  15136. @end deftypevr
  15137. @deftypevr {@code{tlp-configuration} parameter} boolean usb-blacklist-wwan?
  15138. Exclude WWAN devices from USB autosuspend.
  15139. Defaults to @samp{#t}.
  15140. @end deftypevr
  15141. @deftypevr {@code{tlp-configuration} parameter} maybe-string usb-whitelist
  15142. Include specified devices into USB autosuspend, even if they are already
  15143. excluded by the driver or via @code{usb-blacklist-wwan?}.
  15144. Defaults to @samp{disabled}.
  15145. @end deftypevr
  15146. @deftypevr {@code{tlp-configuration} parameter} maybe-boolean usb-autosuspend-disable-on-shutdown?
  15147. Enable USB autosuspend before shutdown.
  15148. Defaults to @samp{disabled}.
  15149. @end deftypevr
  15150. @deftypevr {@code{tlp-configuration} parameter} boolean restore-device-state-on-startup?
  15151. Restore radio device state (bluetooth, wifi, wwan) from previous shutdown on
  15152. system startup.
  15153. Defaults to @samp{#f}.
  15154. @end deftypevr
  15155. @cindex thermald
  15156. @cindex CPU frequency scaling with thermald
  15157. @subsubheading Thermald daemon
  15158. The @code{(gnu services pm)} module provides an interface to thermald, a CPU
  15159. frequency scaling service which helps prevent overheating.
  15160. @defvr {Scheme Variable} thermald-service-type
  15161. This is the service type for @uref{https://01.org/linux-thermal-daemon/,
  15162. thermald}, the Linux Thermal Daemon, which is responsible for controlling
  15163. the thermal state of processors and preventing overheating.
  15164. @end defvr
  15165. @deftp {Data Type} thermald-configuration
  15166. Data type representing the configuration of @code{thermald-service-type}.
  15167. @table @asis
  15168. @item @code{ignore-cpuid-check?} (default: @code{#f})
  15169. Ignore cpuid check for supported CPU models.
  15170. @item @code{thermald} (default: @var{thermald})
  15171. Package object of thermald.
  15172. @end table
  15173. @end deftp
  15174. @node Audio-Dienste
  15175. @subsubsection Audio-Dienste
  15176. The @code{(gnu services audio)} module provides a service to start MPD (the
  15177. Music Player Daemon).
  15178. @cindex mpd
  15179. @subsubheading Music Player Daemon
  15180. The Music Player Daemon (MPD) is a service that can play music while being
  15181. controlled from the local machine or over the network by a variety of
  15182. clients.
  15183. The following example shows how one might run @code{mpd} as user
  15184. @code{"bob"} on port @code{6666}. It uses pulseaudio for output.
  15185. @example
  15186. (service mpd-service-type
  15187. (mpd-configuration
  15188. (user "bob")
  15189. (port "6666")))
  15190. @end example
  15191. @defvr {Scheme Variable} mpd-service-type
  15192. The service type for @command{mpd}
  15193. @end defvr
  15194. @deftp {Data Type} mpd-configuration
  15195. Data type representing the configuration of @command{mpd}.
  15196. @table @asis
  15197. @item @code{user} (default: @code{"mpd"})
  15198. The user to run mpd as.
  15199. @item @code{music-dir} (default: @code{"~/Music"})
  15200. The directory to scan for music files.
  15201. @item @code{playlist-dir} (default: @code{"~/.mpd/playlists"})
  15202. The directory to store playlists.
  15203. @item @code{port} (default: @code{"6600"})
  15204. The port to run mpd on.
  15205. @item @code{address} (default: @code{"any"})
  15206. The address that mpd will bind to. To use a Unix domain socket, an absolute
  15207. path can be specified here.
  15208. @end table
  15209. @end deftp
  15210. @node Virtualisierungsdienste
  15211. @subsubsection Virtualization services
  15212. The @code{(gnu services virtualization)} module provides services for the
  15213. libvirt and virtlog daemons, as well as other virtualization-related
  15214. services.
  15215. @subsubheading Libvirt daemon
  15216. @code{libvirtd} is the server side daemon component of the libvirt
  15217. virtualization management system. This daemon runs on host servers and
  15218. performs required management tasks for virtualized guests.
  15219. @deffn {Scheme Variable} libvirt-service-type
  15220. This is the type of the @uref{https://libvirt.org, libvirt daemon}. Its
  15221. value must be a @code{libvirt-configuration}.
  15222. @example
  15223. (service libvirt-service-type
  15224. (libvirt-configuration
  15225. (unix-sock-group "libvirt")
  15226. (tls-port "16555")))
  15227. @end example
  15228. @end deffn
  15229. @c Auto-generated with (generate-libvirt-documentation)
  15230. Available @code{libvirt-configuration} fields are:
  15231. @deftypevr {@code{libvirt-configuration} parameter} package libvirt
  15232. Libvirt package.
  15233. @end deftypevr
  15234. @deftypevr {@code{libvirt-configuration} parameter} boolean listen-tls?
  15235. Flag listening for secure TLS connections on the public TCP/IP port. must
  15236. set @code{listen} for this to have any effect.
  15237. It is necessary to setup a CA and issue server certificates before using
  15238. this capability.
  15239. Defaults to @samp{#t}.
  15240. @end deftypevr
  15241. @deftypevr {@code{libvirt-configuration} parameter} boolean listen-tcp?
  15242. Listen for unencrypted TCP connections on the public TCP/IP port. must set
  15243. @code{listen} for this to have any effect.
  15244. Using the TCP socket requires SASL authentication by default. Only SASL
  15245. mechanisms which support data encryption are allowed. This is DIGEST_MD5
  15246. and GSSAPI (Kerberos5)
  15247. Defaults to @samp{#f}.
  15248. @end deftypevr
  15249. @deftypevr {@code{libvirt-configuration} parameter} string tls-port
  15250. Port for accepting secure TLS connections This can be a port number, or
  15251. service name
  15252. Defaults to @samp{"16514"}.
  15253. @end deftypevr
  15254. @deftypevr {@code{libvirt-configuration} parameter} string tcp-port
  15255. Port for accepting insecure TCP connections This can be a port number, or
  15256. service name
  15257. Defaults to @samp{"16509"}.
  15258. @end deftypevr
  15259. @deftypevr {@code{libvirt-configuration} parameter} string listen-addr
  15260. IP address or hostname used for client connections.
  15261. Defaults to @samp{"0.0.0.0"}.
  15262. @end deftypevr
  15263. @deftypevr {@code{libvirt-configuration} parameter} boolean mdns-adv?
  15264. Flag toggling mDNS advertisement of the libvirt service.
  15265. Alternatively can disable for all services on a host by stopping the Avahi
  15266. daemon.
  15267. Defaults to @samp{#f}.
  15268. @end deftypevr
  15269. @deftypevr {@code{libvirt-configuration} parameter} string mdns-name
  15270. Default mDNS advertisement name. This must be unique on the immediate
  15271. broadcast network.
  15272. Defaults to @samp{"Virtualization Host <hostname>"}.
  15273. @end deftypevr
  15274. @deftypevr {@code{libvirt-configuration} parameter} string unix-sock-group
  15275. UNIX domain socket group ownership. This can be used to allow a 'trusted'
  15276. set of users access to management capabilities without becoming root.
  15277. Defaults to @samp{"root"}.
  15278. @end deftypevr
  15279. @deftypevr {@code{libvirt-configuration} parameter} string unix-sock-ro-perms
  15280. UNIX socket permissions for the R/O socket. This is used for monitoring VM
  15281. status only.
  15282. Defaults to @samp{"0777"}.
  15283. @end deftypevr
  15284. @deftypevr {@code{libvirt-configuration} parameter} string unix-sock-rw-perms
  15285. UNIX socket permissions for the R/W socket. Default allows only root. If
  15286. PolicyKit is enabled on the socket, the default will change to allow
  15287. everyone (eg, 0777)
  15288. Defaults to @samp{"0770"}.
  15289. @end deftypevr
  15290. @deftypevr {@code{libvirt-configuration} parameter} string unix-sock-admin-perms
  15291. UNIX socket permissions for the admin socket. Default allows only owner
  15292. (root), do not change it unless you are sure to whom you are exposing the
  15293. access to.
  15294. Defaults to @samp{"0777"}.
  15295. @end deftypevr
  15296. @deftypevr {@code{libvirt-configuration} parameter} string unix-sock-dir
  15297. The directory in which sockets will be found/created.
  15298. Defaults to @samp{"/var/run/libvirt"}.
  15299. @end deftypevr
  15300. @deftypevr {@code{libvirt-configuration} parameter} string auth-unix-ro
  15301. Authentication scheme for UNIX read-only sockets. By default socket
  15302. permissions allow anyone to connect
  15303. Defaults to @samp{"polkit"}.
  15304. @end deftypevr
  15305. @deftypevr {@code{libvirt-configuration} parameter} string auth-unix-rw
  15306. Authentication scheme for UNIX read-write sockets. By default socket
  15307. permissions only allow root. If PolicyKit support was compiled into
  15308. libvirt, the default will be to use 'polkit' auth.
  15309. Defaults to @samp{"polkit"}.
  15310. @end deftypevr
  15311. @deftypevr {@code{libvirt-configuration} parameter} string auth-tcp
  15312. Authentication scheme for TCP sockets. If you don't enable SASL, then all
  15313. TCP traffic is cleartext. Don't do this outside of a dev/test scenario.
  15314. Defaults to @samp{"sasl"}.
  15315. @end deftypevr
  15316. @deftypevr {@code{libvirt-configuration} parameter} string auth-tls
  15317. Authentication scheme for TLS sockets. TLS sockets already have encryption
  15318. provided by the TLS layer, and limited authentication is done by
  15319. certificates.
  15320. It is possible to make use of any SASL authentication mechanism as well, by
  15321. using 'sasl' for this option
  15322. Defaults to @samp{"none"}.
  15323. @end deftypevr
  15324. @deftypevr {@code{libvirt-configuration} parameter} optional-list access-drivers
  15325. API access control scheme.
  15326. By default an authenticated user is allowed access to all APIs. Access
  15327. drivers can place restrictions on this.
  15328. Defaults to @samp{()}.
  15329. @end deftypevr
  15330. @deftypevr {@code{libvirt-configuration} parameter} string key-file
  15331. Server key file path. If set to an empty string, then no private key is
  15332. loaded.
  15333. Defaults to @samp{""}.
  15334. @end deftypevr
  15335. @deftypevr {@code{libvirt-configuration} parameter} string cert-file
  15336. Server key file path. If set to an empty string, then no certificate is
  15337. loaded.
  15338. Defaults to @samp{""}.
  15339. @end deftypevr
  15340. @deftypevr {@code{libvirt-configuration} parameter} string ca-file
  15341. Server key file path. If set to an empty string, then no CA certificate is
  15342. loaded.
  15343. Defaults to @samp{""}.
  15344. @end deftypevr
  15345. @deftypevr {@code{libvirt-configuration} parameter} string crl-file
  15346. Certificate revocation list path. If set to an empty string, then no CRL is
  15347. loaded.
  15348. Defaults to @samp{""}.
  15349. @end deftypevr
  15350. @deftypevr {@code{libvirt-configuration} parameter} boolean tls-no-sanity-cert
  15351. Disable verification of our own server certificates.
  15352. When libvirtd starts it performs some sanity checks against its own
  15353. certificates.
  15354. Defaults to @samp{#f}.
  15355. @end deftypevr
  15356. @deftypevr {@code{libvirt-configuration} parameter} boolean tls-no-verify-cert
  15357. Disable verification of client certificates.
  15358. Client certificate verification is the primary authentication mechanism.
  15359. Any client which does not present a certificate signed by the CA will be
  15360. rejected.
  15361. Defaults to @samp{#f}.
  15362. @end deftypevr
  15363. @deftypevr {@code{libvirt-configuration} parameter} optional-list tls-allowed-dn-list
  15364. Whitelist of allowed x509 Distinguished Name.
  15365. Defaults to @samp{()}.
  15366. @end deftypevr
  15367. @deftypevr {@code{libvirt-configuration} parameter} optional-list sasl-allowed-usernames
  15368. Whitelist of allowed SASL usernames. The format for username depends on the
  15369. SASL authentication mechanism.
  15370. Defaults to @samp{()}.
  15371. @end deftypevr
  15372. @deftypevr {@code{libvirt-configuration} parameter} string tls-priority
  15373. Override the compile time default TLS priority string. The default is
  15374. usually "NORMAL" unless overridden at build time. Only set this is it is
  15375. desired for libvirt to deviate from the global default settings.
  15376. Defaults to @samp{"NORMAL"}.
  15377. @end deftypevr
  15378. @deftypevr {@code{libvirt-configuration} parameter} integer max-clients
  15379. Maximum number of concurrent client connections to allow over all sockets
  15380. combined.
  15381. Defaults to @samp{5000}.
  15382. @end deftypevr
  15383. @deftypevr {@code{libvirt-configuration} parameter} integer max-queued-clients
  15384. Maximum length of queue of connections waiting to be accepted by the
  15385. daemon. Note, that some protocols supporting retransmission may obey this
  15386. so that a later reattempt at connection succeeds.
  15387. Defaults to @samp{1000}.
  15388. @end deftypevr
  15389. @deftypevr {@code{libvirt-configuration} parameter} integer max-anonymous-clients
  15390. Maximum length of queue of accepted but not yet authenticated clients. Set
  15391. this to zero to turn this feature off
  15392. Defaults to @samp{20}.
  15393. @end deftypevr
  15394. @deftypevr {@code{libvirt-configuration} parameter} integer min-workers
  15395. Number of workers to start up initially.
  15396. Defaults to @samp{5}.
  15397. @end deftypevr
  15398. @deftypevr {@code{libvirt-configuration} parameter} integer max-workers
  15399. Maximum number of worker threads.
  15400. If the number of active clients exceeds @code{min-workers}, then more
  15401. threads are spawned, up to max_workers limit. Typically you'd want
  15402. max_workers to equal maximum number of clients allowed.
  15403. Defaults to @samp{20}.
  15404. @end deftypevr
  15405. @deftypevr {@code{libvirt-configuration} parameter} integer prio-workers
  15406. Number of priority workers. If all workers from above pool are stuck, some
  15407. calls marked as high priority (notably domainDestroy) can be executed in
  15408. this pool.
  15409. Defaults to @samp{5}.
  15410. @end deftypevr
  15411. @deftypevr {@code{libvirt-configuration} parameter} integer max-requests
  15412. Total global limit on concurrent RPC calls.
  15413. Defaults to @samp{20}.
  15414. @end deftypevr
  15415. @deftypevr {@code{libvirt-configuration} parameter} integer max-client-requests
  15416. Limit on concurrent requests from a single client connection. To avoid one
  15417. client monopolizing the server this should be a small fraction of the global
  15418. max_requests and max_workers parameter.
  15419. Defaults to @samp{5}.
  15420. @end deftypevr
  15421. @deftypevr {@code{libvirt-configuration} parameter} integer admin-min-workers
  15422. Same as @code{min-workers} but for the admin interface.
  15423. Defaults to @samp{1}.
  15424. @end deftypevr
  15425. @deftypevr {@code{libvirt-configuration} parameter} integer admin-max-workers
  15426. Same as @code{max-workers} but for the admin interface.
  15427. Defaults to @samp{5}.
  15428. @end deftypevr
  15429. @deftypevr {@code{libvirt-configuration} parameter} integer admin-max-clients
  15430. Same as @code{max-clients} but for the admin interface.
  15431. Defaults to @samp{5}.
  15432. @end deftypevr
  15433. @deftypevr {@code{libvirt-configuration} parameter} integer admin-max-queued-clients
  15434. Same as @code{max-queued-clients} but for the admin interface.
  15435. Defaults to @samp{5}.
  15436. @end deftypevr
  15437. @deftypevr {@code{libvirt-configuration} parameter} integer admin-max-client-requests
  15438. Same as @code{max-client-requests} but for the admin interface.
  15439. Defaults to @samp{5}.
  15440. @end deftypevr
  15441. @deftypevr {@code{libvirt-configuration} parameter} integer log-level
  15442. Logging level. 4 errors, 3 warnings, 2 information, 1 debug.
  15443. Defaults to @samp{3}.
  15444. @end deftypevr
  15445. @deftypevr {@code{libvirt-configuration} parameter} string log-filters
  15446. Logging filters.
  15447. A filter allows to select a different logging level for a given category of
  15448. logs The format for a filter is one of:
  15449. @itemize @bullet
  15450. @item
  15451. x:name
  15452. @item
  15453. x:+name
  15454. @end itemize
  15455. where @code{name} is a string which is matched against the category given in
  15456. the @code{VIR_LOG_INIT()} at the top of each libvirt source file, e.g.,
  15457. "remote", "qemu", or "util.json" (the name in the filter can be a substring
  15458. of the full category name, in order to match multiple similar categories),
  15459. the optional "+" prefix tells libvirt to log stack trace for each message
  15460. matching name, and @code{x} is the minimal level where matching messages
  15461. should be logged:
  15462. @itemize @bullet
  15463. @item
  15464. 1: DEBUG
  15465. @item
  15466. 2: INFO
  15467. @item
  15468. 3: WARNING
  15469. @item
  15470. 4: ERROR
  15471. @end itemize
  15472. Multiple filters can be defined in a single filters statement, they just
  15473. need to be separated by spaces.
  15474. Defaults to @samp{"3:remote 4:event"}.
  15475. @end deftypevr
  15476. @deftypevr {@code{libvirt-configuration} parameter} string log-outputs
  15477. Logging outputs.
  15478. An output is one of the places to save logging information The format for an
  15479. output can be:
  15480. @table @code
  15481. @item x:stderr
  15482. output goes to stderr
  15483. @item x:syslog:name
  15484. use syslog for the output and use the given name as the ident
  15485. @item x:file:file_path
  15486. output to a file, with the given filepath
  15487. @item x:journald
  15488. output to journald logging system
  15489. @end table
  15490. In all case the x prefix is the minimal level, acting as a filter
  15491. @itemize @bullet
  15492. @item
  15493. 1: DEBUG
  15494. @item
  15495. 2: INFO
  15496. @item
  15497. 3: WARNING
  15498. @item
  15499. 4: ERROR
  15500. @end itemize
  15501. Multiple outputs can be defined, they just need to be separated by spaces.
  15502. Defaults to @samp{"3:stderr"}.
  15503. @end deftypevr
  15504. @deftypevr {@code{libvirt-configuration} parameter} integer audit-level
  15505. Allows usage of the auditing subsystem to be altered
  15506. @itemize @bullet
  15507. @item
  15508. 0: disable all auditing
  15509. @item
  15510. 1: enable auditing, only if enabled on host
  15511. @item
  15512. 2: enable auditing, and exit if disabled on host.
  15513. @end itemize
  15514. Defaults to @samp{1}.
  15515. @end deftypevr
  15516. @deftypevr {@code{libvirt-configuration} parameter} boolean audit-logging
  15517. Send audit messages via libvirt logging infrastructure.
  15518. Defaults to @samp{#f}.
  15519. @end deftypevr
  15520. @deftypevr {@code{libvirt-configuration} parameter} optional-string host-uuid
  15521. Host UUID. UUID must not have all digits be the same.
  15522. Defaults to @samp{""}.
  15523. @end deftypevr
  15524. @deftypevr {@code{libvirt-configuration} parameter} string host-uuid-source
  15525. Source to read host UUID.
  15526. @itemize @bullet
  15527. @item
  15528. @code{smbios}: fetch the UUID from @code{dmidecode -s system-uuid}
  15529. @item
  15530. @code{machine-id}: fetch the UUID from @code{/etc/machine-id}
  15531. @end itemize
  15532. If @code{dmidecode} does not provide a valid UUID a temporary UUID will be
  15533. generated.
  15534. Defaults to @samp{"smbios"}.
  15535. @end deftypevr
  15536. @deftypevr {@code{libvirt-configuration} parameter} integer keepalive-interval
  15537. A keepalive message is sent to a client after @code{keepalive_interval}
  15538. seconds of inactivity to check if the client is still responding. If set to
  15539. -1, libvirtd will never send keepalive requests; however clients can still
  15540. send them and the daemon will send responses.
  15541. Defaults to @samp{5}.
  15542. @end deftypevr
  15543. @deftypevr {@code{libvirt-configuration} parameter} integer keepalive-count
  15544. Maximum number of keepalive messages that are allowed to be sent to the
  15545. client without getting any response before the connection is considered
  15546. broken.
  15547. In other words, the connection is automatically closed approximately after
  15548. @code{keepalive_interval * (keepalive_count + 1)} seconds since the last
  15549. message received from the client. When @code{keepalive-count} is set to 0,
  15550. connections will be automatically closed after @code{keepalive-interval}
  15551. seconds of inactivity without sending any keepalive messages.
  15552. Defaults to @samp{5}.
  15553. @end deftypevr
  15554. @deftypevr {@code{libvirt-configuration} parameter} integer admin-keepalive-interval
  15555. Same as above but for admin interface.
  15556. Defaults to @samp{5}.
  15557. @end deftypevr
  15558. @deftypevr {@code{libvirt-configuration} parameter} integer admin-keepalive-count
  15559. Same as above but for admin interface.
  15560. Defaults to @samp{5}.
  15561. @end deftypevr
  15562. @deftypevr {@code{libvirt-configuration} parameter} integer ovs-timeout
  15563. Timeout for Open vSwitch calls.
  15564. The @code{ovs-vsctl} utility is used for the configuration and its timeout
  15565. option is set by default to 5 seconds to avoid potential infinite waits
  15566. blocking libvirt.
  15567. Defaults to @samp{5}.
  15568. @end deftypevr
  15569. @c %end of autogenerated docs
  15570. @subsubheading Virtlog daemon
  15571. The virtlogd service is a server side daemon component of libvirt that is
  15572. used to manage logs from virtual machine consoles.
  15573. This daemon is not used directly by libvirt client applications, rather it
  15574. is called on their behalf by @code{libvirtd}. By maintaining the logs in a
  15575. standalone daemon, the main @code{libvirtd} daemon can be restarted without
  15576. risk of losing logs. The @code{virtlogd} daemon has the ability to re-exec()
  15577. itself upon receiving @code{SIGUSR1}, to allow live upgrades without
  15578. downtime.
  15579. @deffn {Scheme Variable} virtlog-service-type
  15580. This is the type of the virtlog daemon. Its value must be a
  15581. @code{virtlog-configuration}.
  15582. @example
  15583. (service virtlog-service-type
  15584. (virtlog-configuration
  15585. (max-clients 1000)))
  15586. @end example
  15587. @end deffn
  15588. @deftypevr {@code{virtlog-configuration} parameter} integer log-level
  15589. Logging level. 4 errors, 3 warnings, 2 information, 1 debug.
  15590. Defaults to @samp{3}.
  15591. @end deftypevr
  15592. @deftypevr {@code{virtlog-configuration} parameter} string log-filters
  15593. Logging filters.
  15594. A filter allows to select a different logging level for a given category of
  15595. logs The format for a filter is one of:
  15596. @itemize @bullet
  15597. @item
  15598. x:name
  15599. @item
  15600. x:+name
  15601. @end itemize
  15602. where @code{name} is a string which is matched against the category given in
  15603. the @code{VIR_LOG_INIT()} at the top of each libvirt source file, e.g.,
  15604. "remote", "qemu", or "util.json" (the name in the filter can be a substring
  15605. of the full category name, in order to match multiple similar categories),
  15606. the optional "+" prefix tells libvirt to log stack trace for each message
  15607. matching name, and @code{x} is the minimal level where matching messages
  15608. should be logged:
  15609. @itemize @bullet
  15610. @item
  15611. 1: DEBUG
  15612. @item
  15613. 2: INFO
  15614. @item
  15615. 3: WARNING
  15616. @item
  15617. 4: ERROR
  15618. @end itemize
  15619. Multiple filters can be defined in a single filters statement, they just
  15620. need to be separated by spaces.
  15621. Defaults to @samp{"3:remote 4:event"}.
  15622. @end deftypevr
  15623. @deftypevr {@code{virtlog-configuration} parameter} string log-outputs
  15624. Logging outputs.
  15625. An output is one of the places to save logging information The format for an
  15626. output can be:
  15627. @table @code
  15628. @item x:stderr
  15629. output goes to stderr
  15630. @item x:syslog:name
  15631. use syslog for the output and use the given name as the ident
  15632. @item x:file:file_path
  15633. output to a file, with the given filepath
  15634. @item x:journald
  15635. output to journald logging system
  15636. @end table
  15637. In all case the x prefix is the minimal level, acting as a filter
  15638. @itemize @bullet
  15639. @item
  15640. 1: DEBUG
  15641. @item
  15642. 2: INFO
  15643. @item
  15644. 3: WARNING
  15645. @item
  15646. 4: ERROR
  15647. @end itemize
  15648. Multiple outputs can be defined, they just need to be separated by spaces.
  15649. Defaults to @samp{"3:stderr"}.
  15650. @end deftypevr
  15651. @deftypevr {@code{virtlog-configuration} parameter} integer max-clients
  15652. Maximum number of concurrent client connections to allow over all sockets
  15653. combined.
  15654. Defaults to @samp{1024}.
  15655. @end deftypevr
  15656. @deftypevr {@code{virtlog-configuration} parameter} integer max-size
  15657. Maximum file size before rolling over.
  15658. Defaults to @samp{2MB}
  15659. @end deftypevr
  15660. @deftypevr {@code{virtlog-configuration} parameter} integer max-backups
  15661. Maximum number of backup files to keep.
  15662. Defaults to @samp{3}
  15663. @end deftypevr
  15664. @subsubheading Transparent Emulation with QEMU
  15665. @cindex emulation
  15666. @cindex @code{binfmt_misc}
  15667. @code{qemu-binfmt-service-type} provides support for transparent emulation
  15668. of program binaries built for different architectures---e.g., it allows you
  15669. to transparently execute an ARMv7 program on an x86_64 machine. It achieves
  15670. this by combining the @uref{https://www.qemu.org, QEMU} emulator and the
  15671. @code{binfmt_misc} feature of the kernel Linux.
  15672. @defvr {Scheme Variable} qemu-binfmt-service-type
  15673. This is the type of the QEMU/binfmt service for transparent emulation. Its
  15674. value must be a @code{qemu-binfmt-configuration} object, which specifies the
  15675. QEMU package to use as well as the architecture we want to emulated:
  15676. @example
  15677. (service qemu-binfmt-service-type
  15678. (qemu-binfmt-configuration
  15679. (platforms (lookup-qemu-platforms "arm" "aarch64" "ppc"))))
  15680. @end example
  15681. In this example, we enable transparent emulation for the ARM and aarch64
  15682. platforms. Running @code{herd stop qemu-binfmt} turns it off, and running
  15683. @code{herd start qemu-binfmt} turns it back on (@pxref{Invoking herd, the
  15684. @command{herd} command,, shepherd, The GNU Shepherd Manual}).
  15685. @end defvr
  15686. @deftp {Data Type} qemu-binfmt-configuration
  15687. This is the configuration for the @code{qemu-binfmt} service.
  15688. @table @asis
  15689. @item @code{platforms} (default: @code{'()})
  15690. The list of emulated QEMU platforms. Each item must be a @dfn{platform
  15691. object} as returned by @code{lookup-qemu-platforms} (see below).
  15692. @item @code{guix-support?} (default: @code{#f})
  15693. When it is true, QEMU and all its dependencies are added to the build
  15694. environment of @command{guix-daemon} (@pxref{Aufruf des guix-daemon,
  15695. @code{--chroot-directory} option}). This allows the @code{binfmt_misc}
  15696. handlers to be used within the build environment, which in turn means that
  15697. you can transparently build programs for another architecture.
  15698. For example, let's suppose you're on an x86_64 machine and you have this
  15699. service:
  15700. @example
  15701. (service qemu-binfmt-service-type
  15702. (qemu-binfmt-configuration
  15703. (platforms (lookup-qemu-platforms "arm"))
  15704. (guix-support? #t)))
  15705. @end example
  15706. You can run:
  15707. @example
  15708. guix build -s armhf-linux inkscape
  15709. @end example
  15710. @noindent
  15711. and it will build Inkscape for ARMv7 @emph{as if it were a native build},
  15712. transparently using QEMU to emulate the ARMv7 CPU. Pretty handy if you'd
  15713. like to test a package build for an architecture you don't have access to!
  15714. @item @code{qemu} (default: @code{qemu})
  15715. The QEMU package to use.
  15716. @end table
  15717. @end deftp
  15718. @deffn {Scheme Procedure} lookup-qemu-platforms @var{platforms}@dots{}
  15719. Return the list of QEMU platform objects corresponding to
  15720. @var{platforms}@dots{}. @var{platforms} must be a list of strings
  15721. corresponding to platform names, such as @code{"arm"}, @code{"sparc"},
  15722. @code{"mips64el"}, and so on.
  15723. @end deffn
  15724. @deffn {Scheme Procedure} qemu-platform? @var{obj}
  15725. Return true if @var{obj} is a platform object.
  15726. @end deffn
  15727. @deffn {Scheme Procedure} qemu-platform-name @var{platform}
  15728. Return the name of @var{platform}---a string such as @code{"arm"}.
  15729. @end deffn
  15730. @node Versionskontrolldienste
  15731. @subsubsection Versionskontrolldienste
  15732. The @code{(gnu services version-control)} module provides a service to allow
  15733. remote access to local Git repositories. There are three options: the
  15734. @code{git-daemon-service}, which provides access to repositories via the
  15735. @code{git://} unsecured TCP-based protocol, extending the @code{nginx} web
  15736. server to proxy some requests to @code{git-http-backend}, or providing a web
  15737. interface with @code{cgit-service-type}.
  15738. @deffn {Scheme Procedure} git-daemon-service [#:config (git-daemon-configuration)]
  15739. Return a service that runs @command{git daemon}, a simple TCP server to
  15740. expose repositories over the Git protocol for anonymous access.
  15741. The optional @var{config} argument should be a
  15742. @code{<git-daemon-configuration>} object, by default it allows read-only
  15743. access to exported@footnote{By creating the magic file
  15744. "git-daemon-export-ok" in the repository directory.} repositories under
  15745. @file{/srv/git}.
  15746. @end deffn
  15747. @deftp {Data Type} git-daemon-configuration
  15748. Data type representing the configuration for @code{git-daemon-service}.
  15749. @table @asis
  15750. @item @code{package} (default: @var{git})
  15751. Package object of the Git distributed version control system.
  15752. @item @code{export-all?} (default: @var{#f})
  15753. Whether to allow access for all Git repositories, even if they do not have
  15754. the @file{git-daemon-export-ok} file.
  15755. @item @code{base-path} (default: @file{/srv/git})
  15756. Whether to remap all the path requests as relative to the given path. If
  15757. you run git daemon with @var{(base-path "/srv/git")} on example.com, then if
  15758. you later try to pull @code{git://example.com/hello.git}, git daemon will
  15759. interpret the path as @code{/srv/git/hello.git}.
  15760. @item @code{user-path} (default: @var{#f})
  15761. Whether to allow @code{~user} notation to be used in requests. When
  15762. specified with empty string, requests to @code{git://host/~alice/foo} is
  15763. taken as a request to access @code{foo} repository in the home directory of
  15764. user @code{alice}. If @var{(user-path "path")} is specified, the same
  15765. request is taken as a request to access @code{path/foo} repository in the
  15766. home directory of user @code{alice}.
  15767. @item @code{listen} (default: @var{'()})
  15768. Whether to listen on specific IP addresses or hostnames, defaults to all.
  15769. @item @code{port} (default: @var{#f})
  15770. Whether to listen on an alternative port, which defaults to 9418.
  15771. @item @code{whitelist} (default: @var{'()})
  15772. If not empty, only allow access to this list of directories.
  15773. @item @code{extra-options} (default: @var{'()})
  15774. Extra options will be passed to @code{git daemon}, please run @command{man
  15775. git-daemon} for more information.
  15776. @end table
  15777. @end deftp
  15778. The @code{git://} protocol lacks authentication. When you pull from a
  15779. repository fetched via @code{git://}, you don't know that the data you
  15780. receive was modified is really coming from the specified host, and you have
  15781. your connection is subject to eavesdropping. It's better to use an
  15782. authenticated and encrypted transport, such as @code{https}. Although Git
  15783. allows you to serve repositories using unsophisticated file-based web
  15784. servers, there is a faster protocol implemented by the
  15785. @code{git-http-backend} program. This program is the back-end of a proper
  15786. Git web service. It is designed to sit behind a FastCGI proxy. @xref{Web-Dienste}, for more on running the necessary @code{fcgiwrap} daemon.
  15787. Guix has a separate configuration data type for serving Git repositories
  15788. over HTTP.
  15789. @deftp {Data Type} git-http-configuration
  15790. Data type representing the configuration for @code{git-http-service}.
  15791. @table @asis
  15792. @item @code{package} (default: @var{git})
  15793. Package object of the Git distributed version control system.
  15794. @item @code{git-root} (default: @file{/srv/git})
  15795. Directory containing the Git repositories to expose to the world.
  15796. @item @code{export-all?} (default: @var{#f})
  15797. Whether to expose access for all Git repositories in @var{git-root}, even if
  15798. they do not have the @file{git-daemon-export-ok} file.
  15799. @item @code{uri-path} (default: @file{/git/})
  15800. Path prefix for Git access. With the default @code{/git/} prefix, this will
  15801. map @code{http://@var{server}/git/@var{repo}.git} to
  15802. @code{/srv/git/@var{repo}.git}. Requests whose URI paths do not begin with
  15803. this prefix are not passed on to this Git instance.
  15804. @item @code{fcgiwrap-socket} (default: @code{127.0.0.1:9000})
  15805. The socket on which the @code{fcgiwrap} daemon is listening. @xref{Web-Dienste}.
  15806. @end table
  15807. @end deftp
  15808. There is no @code{git-http-service-type}, currently; instead you can create
  15809. an @code{nginx-location-configuration} from a @code{git-http-configuration}
  15810. and then add that location to a web server.
  15811. @deffn {Scheme Procedure} git-http-nginx-location-configuration @
  15812. [config=(git-http-configuration)] Compute an
  15813. @code{nginx-location-configuration} that corresponds to the given Git http
  15814. configuration. An example nginx service definition to serve the default
  15815. @file{/srv/git} over HTTPS might be:
  15816. @example
  15817. (service nginx-service-type
  15818. (nginx-configuration
  15819. (server-blocks
  15820. (list
  15821. (nginx-server-configuration
  15822. (listen '("443 ssl"))
  15823. (server-name "git.my-host.org")
  15824. (ssl-certificate
  15825. "/etc/letsencrypt/live/git.my-host.org/fullchain.pem")
  15826. (ssl-certificate-key
  15827. "/etc/letsencrypt/live/git.my-host.org/privkey.pem")
  15828. (locations
  15829. (list
  15830. (git-http-nginx-location-configuration
  15831. (git-http-configuration (uri-path "/"))))))))))
  15832. @end example
  15833. This example assumes that you are using Let's Encrypt to get your TLS
  15834. certificate. @xref{Zertifikatsdienste}. The default @code{certbot}
  15835. service will redirect all HTTP traffic on @code{git.my-host.org} to HTTPS.
  15836. You will also need to add an @code{fcgiwrap} proxy to your system services.
  15837. @xref{Web-Dienste}.
  15838. @end deffn
  15839. @subsubheading Cgit Service
  15840. @cindex Cgit service
  15841. @cindex Git, web interface
  15842. @uref{https://git.zx2c4.com/cgit/, Cgit} is a web frontend for Git
  15843. repositories written in C.
  15844. The following example will configure the service with default values. By
  15845. default, Cgit can be accessed on port 80 (@code{http://localhost:80}).
  15846. @example
  15847. (service cgit-service-type)
  15848. @end example
  15849. The @code{file-object} type designates either a file-like object
  15850. (@pxref{G-Ausdrücke, file-like objects}) or a string.
  15851. @c %start of fragment
  15852. Available @code{cgit-configuration} fields are:
  15853. @deftypevr {@code{cgit-configuration} parameter} package package
  15854. The CGIT package.
  15855. @end deftypevr
  15856. @deftypevr {@code{cgit-configuration} parameter} nginx-server-configuration-list nginx
  15857. NGINX configuration.
  15858. @end deftypevr
  15859. @deftypevr {@code{cgit-configuration} parameter} file-object about-filter
  15860. Specifies a command which will be invoked to format the content of about
  15861. pages (both top-level and for each repository).
  15862. Defaults to @samp{""}.
  15863. @end deftypevr
  15864. @deftypevr {@code{cgit-configuration} parameter} string agefile
  15865. Specifies a path, relative to each repository path, which can be used to
  15866. specify the date and time of the youngest commit in the repository.
  15867. Defaults to @samp{""}.
  15868. @end deftypevr
  15869. @deftypevr {@code{cgit-configuration} parameter} file-object auth-filter
  15870. Specifies a command that will be invoked for authenticating repository
  15871. access.
  15872. Defaults to @samp{""}.
  15873. @end deftypevr
  15874. @deftypevr {@code{cgit-configuration} parameter} string branch-sort
  15875. Flag which, when set to @samp{age}, enables date ordering in the branch ref
  15876. list, and when set @samp{name} enables ordering by branch name.
  15877. Defaults to @samp{"name"}.
  15878. @end deftypevr
  15879. @deftypevr {@code{cgit-configuration} parameter} string cache-root
  15880. Path used to store the cgit cache entries.
  15881. Defaults to @samp{"/var/cache/cgit"}.
  15882. @end deftypevr
  15883. @deftypevr {@code{cgit-configuration} parameter} integer cache-static-ttl
  15884. Number which specifies the time-to-live, in minutes, for the cached version
  15885. of repository pages accessed with a fixed SHA1.
  15886. Defaults to @samp{-1}.
  15887. @end deftypevr
  15888. @deftypevr {@code{cgit-configuration} parameter} integer cache-dynamic-ttl
  15889. Number which specifies the time-to-live, in minutes, for the cached version
  15890. of repository pages accessed without a fixed SHA1.
  15891. Defaults to @samp{5}.
  15892. @end deftypevr
  15893. @deftypevr {@code{cgit-configuration} parameter} integer cache-repo-ttl
  15894. Number which specifies the time-to-live, in minutes, for the cached version
  15895. of the repository summary page.
  15896. Defaults to @samp{5}.
  15897. @end deftypevr
  15898. @deftypevr {@code{cgit-configuration} parameter} integer cache-root-ttl
  15899. Number which specifies the time-to-live, in minutes, for the cached version
  15900. of the repository index page.
  15901. Defaults to @samp{5}.
  15902. @end deftypevr
  15903. @deftypevr {@code{cgit-configuration} parameter} integer cache-scanrc-ttl
  15904. Number which specifies the time-to-live, in minutes, for the result of
  15905. scanning a path for Git repositories.
  15906. Defaults to @samp{15}.
  15907. @end deftypevr
  15908. @deftypevr {@code{cgit-configuration} parameter} integer cache-about-ttl
  15909. Number which specifies the time-to-live, in minutes, for the cached version
  15910. of the repository about page.
  15911. Defaults to @samp{15}.
  15912. @end deftypevr
  15913. @deftypevr {@code{cgit-configuration} parameter} integer cache-snapshot-ttl
  15914. Number which specifies the time-to-live, in minutes, for the cached version
  15915. of snapshots.
  15916. Defaults to @samp{5}.
  15917. @end deftypevr
  15918. @deftypevr {@code{cgit-configuration} parameter} integer cache-size
  15919. The maximum number of entries in the cgit cache. When set to @samp{0},
  15920. caching is disabled.
  15921. Defaults to @samp{0}.
  15922. @end deftypevr
  15923. @deftypevr {@code{cgit-configuration} parameter} boolean case-sensitive-sort?
  15924. Sort items in the repo list case sensitively.
  15925. Defaults to @samp{#t}.
  15926. @end deftypevr
  15927. @deftypevr {@code{cgit-configuration} parameter} list clone-prefix
  15928. List of common prefixes which, when combined with a repository URL,
  15929. generates valid clone URLs for the repository.
  15930. Defaults to @samp{()}.
  15931. @end deftypevr
  15932. @deftypevr {@code{cgit-configuration} parameter} list clone-url
  15933. List of @code{clone-url} templates.
  15934. Defaults to @samp{()}.
  15935. @end deftypevr
  15936. @deftypevr {@code{cgit-configuration} parameter} file-object commit-filter
  15937. Command which will be invoked to format commit messages.
  15938. Defaults to @samp{""}.
  15939. @end deftypevr
  15940. @deftypevr {@code{cgit-configuration} parameter} string commit-sort
  15941. Flag which, when set to @samp{date}, enables strict date ordering in the
  15942. commit log, and when set to @samp{topo} enables strict topological ordering.
  15943. Defaults to @samp{"git log"}.
  15944. @end deftypevr
  15945. @deftypevr {@code{cgit-configuration} parameter} file-object css
  15946. URL which specifies the css document to include in all cgit pages.
  15947. Defaults to @samp{"/share/cgit/cgit.css"}.
  15948. @end deftypevr
  15949. @deftypevr {@code{cgit-configuration} parameter} file-object email-filter
  15950. Specifies a command which will be invoked to format names and email address
  15951. of committers, authors, and taggers, as represented in various places
  15952. throughout the cgit interface.
  15953. Defaults to @samp{""}.
  15954. @end deftypevr
  15955. @deftypevr {@code{cgit-configuration} parameter} boolean embedded?
  15956. Flag which, when set to @samp{#t}, will make cgit generate a HTML fragment
  15957. suitable for embedding in other HTML pages.
  15958. Defaults to @samp{#f}.
  15959. @end deftypevr
  15960. @deftypevr {@code{cgit-configuration} parameter} boolean enable-commit-graph?
  15961. Flag which, when set to @samp{#t}, will make cgit print an ASCII-art commit
  15962. history graph to the left of the commit messages in the repository log page.
  15963. Defaults to @samp{#f}.
  15964. @end deftypevr
  15965. @deftypevr {@code{cgit-configuration} parameter} boolean enable-filter-overrides?
  15966. Flag which, when set to @samp{#t}, allows all filter settings to be
  15967. overridden in repository-specific cgitrc files.
  15968. Defaults to @samp{#f}.
  15969. @end deftypevr
  15970. @deftypevr {@code{cgit-configuration} parameter} boolean enable-follow-links?
  15971. Flag which, when set to @samp{#t}, allows users to follow a file in the log
  15972. view.
  15973. Defaults to @samp{#f}.
  15974. @end deftypevr
  15975. @deftypevr {@code{cgit-configuration} parameter} boolean enable-http-clone?
  15976. If set to @samp{#t}, cgit will act as an dumb HTTP endpoint for Git clones.
  15977. Defaults to @samp{#t}.
  15978. @end deftypevr
  15979. @deftypevr {@code{cgit-configuration} parameter} boolean enable-index-links?
  15980. Flag which, when set to @samp{#t}, will make cgit generate extra links
  15981. "summary", "commit", "tree" for each repo in the repository index.
  15982. Defaults to @samp{#f}.
  15983. @end deftypevr
  15984. @deftypevr {@code{cgit-configuration} parameter} boolean enable-index-owner?
  15985. Flag which, when set to @samp{#t}, will make cgit display the owner of each
  15986. repo in the repository index.
  15987. Defaults to @samp{#t}.
  15988. @end deftypevr
  15989. @deftypevr {@code{cgit-configuration} parameter} boolean enable-log-filecount?
  15990. Flag which, when set to @samp{#t}, will make cgit print the number of
  15991. modified files for each commit on the repository log page.
  15992. Defaults to @samp{#f}.
  15993. @end deftypevr
  15994. @deftypevr {@code{cgit-configuration} parameter} boolean enable-log-linecount?
  15995. Flag which, when set to @samp{#t}, will make cgit print the number of added
  15996. and removed lines for each commit on the repository log page.
  15997. Defaults to @samp{#f}.
  15998. @end deftypevr
  15999. @deftypevr {@code{cgit-configuration} parameter} boolean enable-remote-branches?
  16000. Flag which, when set to @code{#t}, will make cgit display remote branches in
  16001. the summary and refs views.
  16002. Defaults to @samp{#f}.
  16003. @end deftypevr
  16004. @deftypevr {@code{cgit-configuration} parameter} boolean enable-subject-links?
  16005. Flag which, when set to @code{1}, will make cgit use the subject of the
  16006. parent commit as link text when generating links to parent commits in commit
  16007. view.
  16008. Defaults to @samp{#f}.
  16009. @end deftypevr
  16010. @deftypevr {@code{cgit-configuration} parameter} boolean enable-html-serving?
  16011. Flag which, when set to @samp{#t}, will make cgit use the subject of the
  16012. parent commit as link text when generating links to parent commits in commit
  16013. view.
  16014. Defaults to @samp{#f}.
  16015. @end deftypevr
  16016. @deftypevr {@code{cgit-configuration} parameter} boolean enable-tree-linenumbers?
  16017. Flag which, when set to @samp{#t}, will make cgit generate linenumber links
  16018. for plaintext blobs printed in the tree view.
  16019. Defaults to @samp{#t}.
  16020. @end deftypevr
  16021. @deftypevr {@code{cgit-configuration} parameter} boolean enable-git-config?
  16022. Flag which, when set to @samp{#f}, will allow cgit to use Git config to set
  16023. any repo specific settings.
  16024. Defaults to @samp{#f}.
  16025. @end deftypevr
  16026. @deftypevr {@code{cgit-configuration} parameter} file-object favicon
  16027. URL used as link to a shortcut icon for cgit.
  16028. Defaults to @samp{"/favicon.ico"}.
  16029. @end deftypevr
  16030. @deftypevr {@code{cgit-configuration} parameter} string footer
  16031. The content of the file specified with this option will be included verbatim
  16032. at the bottom of all pages (i.e.@: it replaces the standard "generated
  16033. by..."@: message).
  16034. Defaults to @samp{""}.
  16035. @end deftypevr
  16036. @deftypevr {@code{cgit-configuration} parameter} string head-include
  16037. The content of the file specified with this option will be included verbatim
  16038. in the HTML HEAD section on all pages.
  16039. Defaults to @samp{""}.
  16040. @end deftypevr
  16041. @deftypevr {@code{cgit-configuration} parameter} string header
  16042. The content of the file specified with this option will be included verbatim
  16043. at the top of all pages.
  16044. Defaults to @samp{""}.
  16045. @end deftypevr
  16046. @deftypevr {@code{cgit-configuration} parameter} file-object include
  16047. Name of a configfile to include before the rest of the current config- file
  16048. is parsed.
  16049. Defaults to @samp{""}.
  16050. @end deftypevr
  16051. @deftypevr {@code{cgit-configuration} parameter} string index-header
  16052. The content of the file specified with this option will be included verbatim
  16053. above the repository index.
  16054. Defaults to @samp{""}.
  16055. @end deftypevr
  16056. @deftypevr {@code{cgit-configuration} parameter} string index-info
  16057. The content of the file specified with this option will be included verbatim
  16058. below the heading on the repository index page.
  16059. Defaults to @samp{""}.
  16060. @end deftypevr
  16061. @deftypevr {@code{cgit-configuration} parameter} boolean local-time?
  16062. Flag which, if set to @samp{#t}, makes cgit print commit and tag times in
  16063. the servers timezone.
  16064. Defaults to @samp{#f}.
  16065. @end deftypevr
  16066. @deftypevr {@code{cgit-configuration} parameter} file-object logo
  16067. URL which specifies the source of an image which will be used as a logo on
  16068. all cgit pages.
  16069. Defaults to @samp{"/share/cgit/cgit.png"}.
  16070. @end deftypevr
  16071. @deftypevr {@code{cgit-configuration} parameter} string logo-link
  16072. URL loaded when clicking on the cgit logo image.
  16073. Defaults to @samp{""}.
  16074. @end deftypevr
  16075. @deftypevr {@code{cgit-configuration} parameter} file-object owner-filter
  16076. Command which will be invoked to format the Owner column of the main page.
  16077. Defaults to @samp{""}.
  16078. @end deftypevr
  16079. @deftypevr {@code{cgit-configuration} parameter} integer max-atom-items
  16080. Number of items to display in atom feeds view.
  16081. Defaults to @samp{10}.
  16082. @end deftypevr
  16083. @deftypevr {@code{cgit-configuration} parameter} integer max-commit-count
  16084. Number of entries to list per page in "log" view.
  16085. Defaults to @samp{50}.
  16086. @end deftypevr
  16087. @deftypevr {@code{cgit-configuration} parameter} integer max-message-length
  16088. Number of commit message characters to display in "log" view.
  16089. Defaults to @samp{80}.
  16090. @end deftypevr
  16091. @deftypevr {@code{cgit-configuration} parameter} integer max-repo-count
  16092. Specifies the number of entries to list per page on the repository index
  16093. page.
  16094. Defaults to @samp{50}.
  16095. @end deftypevr
  16096. @deftypevr {@code{cgit-configuration} parameter} integer max-repodesc-length
  16097. Specifies the maximum number of repo description characters to display on
  16098. the repository index page.
  16099. Defaults to @samp{80}.
  16100. @end deftypevr
  16101. @deftypevr {@code{cgit-configuration} parameter} integer max-blob-size
  16102. Specifies the maximum size of a blob to display HTML for in KBytes.
  16103. Defaults to @samp{0}.
  16104. @end deftypevr
  16105. @deftypevr {@code{cgit-configuration} parameter} string max-stats
  16106. Maximum statistics period. Valid values are @samp{week},@samp{month},
  16107. @samp{quarter} and @samp{year}.
  16108. Defaults to @samp{""}.
  16109. @end deftypevr
  16110. @deftypevr {@code{cgit-configuration} parameter} mimetype-alist mimetype
  16111. Mimetype for the specified filename extension.
  16112. Defaults to @samp{((gif "image/gif") (html "text/html") (jpg "image/jpeg")
  16113. (jpeg "image/jpeg") (pdf "application/pdf") (png "image/png") (svg
  16114. "image/svg+xml"))}.
  16115. @end deftypevr
  16116. @deftypevr {@code{cgit-configuration} parameter} file-object mimetype-file
  16117. Specifies the file to use for automatic mimetype lookup.
  16118. Defaults to @samp{""}.
  16119. @end deftypevr
  16120. @deftypevr {@code{cgit-configuration} parameter} string module-link
  16121. Text which will be used as the formatstring for a hyperlink when a submodule
  16122. is printed in a directory listing.
  16123. Defaults to @samp{""}.
  16124. @end deftypevr
  16125. @deftypevr {@code{cgit-configuration} parameter} boolean nocache?
  16126. If set to the value @samp{#t} caching will be disabled.
  16127. Defaults to @samp{#f}.
  16128. @end deftypevr
  16129. @deftypevr {@code{cgit-configuration} parameter} boolean noplainemail?
  16130. If set to @samp{#t} showing full author email addresses will be disabled.
  16131. Defaults to @samp{#f}.
  16132. @end deftypevr
  16133. @deftypevr {@code{cgit-configuration} parameter} boolean noheader?
  16134. Flag which, when set to @samp{#t}, will make cgit omit the standard header
  16135. on all pages.
  16136. Defaults to @samp{#f}.
  16137. @end deftypevr
  16138. @deftypevr {@code{cgit-configuration} parameter} project-list project-list
  16139. A list of subdirectories inside of @code{repository-directory}, relative to
  16140. it, that should loaded as Git repositories. An empty list means that all
  16141. subdirectories will be loaded.
  16142. Defaults to @samp{()}.
  16143. @end deftypevr
  16144. @deftypevr {@code{cgit-configuration} parameter} file-object readme
  16145. Text which will be used as default value for @code{cgit-repo-readme}.
  16146. Defaults to @samp{""}.
  16147. @end deftypevr
  16148. @deftypevr {@code{cgit-configuration} parameter} boolean remove-suffix?
  16149. If set to @code{#t} and @code{repository-directory} is enabled, if any
  16150. repositories are found with a suffix of @code{.git}, this suffix will be
  16151. removed for the URL and name.
  16152. Defaults to @samp{#f}.
  16153. @end deftypevr
  16154. @deftypevr {@code{cgit-configuration} parameter} integer renamelimit
  16155. Maximum number of files to consider when detecting renames.
  16156. Defaults to @samp{-1}.
  16157. @end deftypevr
  16158. @deftypevr {@code{cgit-configuration} parameter} string repository-sort
  16159. The way in which repositories in each section are sorted.
  16160. Defaults to @samp{""}.
  16161. @end deftypevr
  16162. @deftypevr {@code{cgit-configuration} parameter} robots-list robots
  16163. Text used as content for the @code{robots} meta-tag.
  16164. Defaults to @samp{("noindex" "nofollow")}.
  16165. @end deftypevr
  16166. @deftypevr {@code{cgit-configuration} parameter} string root-desc
  16167. Text printed below the heading on the repository index page.
  16168. Defaults to @samp{"a fast webinterface for the git dscm"}.
  16169. @end deftypevr
  16170. @deftypevr {@code{cgit-configuration} parameter} string root-readme
  16171. The content of the file specified with this option will be included verbatim
  16172. below thef "about" link on the repository index page.
  16173. Defaults to @samp{""}.
  16174. @end deftypevr
  16175. @deftypevr {@code{cgit-configuration} parameter} string root-title
  16176. Text printed as heading on the repository index page.
  16177. Defaults to @samp{""}.
  16178. @end deftypevr
  16179. @deftypevr {@code{cgit-configuration} parameter} boolean scan-hidden-path
  16180. If set to @samp{#t} and repository-directory is enabled,
  16181. repository-directory will recurse into directories whose name starts with a
  16182. period. Otherwise, repository-directory will stay away from such
  16183. directories, considered as "hidden". Note that this does not apply to the
  16184. ".git" directory in non-bare repos.
  16185. Defaults to @samp{#f}.
  16186. @end deftypevr
  16187. @deftypevr {@code{cgit-configuration} parameter} list snapshots
  16188. Text which specifies the default set of snapshot formats that cgit generates
  16189. links for.
  16190. Defaults to @samp{()}.
  16191. @end deftypevr
  16192. @deftypevr {@code{cgit-configuration} parameter} repository-directory repository-directory
  16193. Name of the directory to scan for repositories (represents
  16194. @code{scan-path}).
  16195. Defaults to @samp{"/srv/git"}.
  16196. @end deftypevr
  16197. @deftypevr {@code{cgit-configuration} parameter} string section
  16198. The name of the current repository section - all repositories defined after
  16199. this option will inherit the current section name.
  16200. Defaults to @samp{""}.
  16201. @end deftypevr
  16202. @deftypevr {@code{cgit-configuration} parameter} string section-sort
  16203. Flag which, when set to @samp{1}, will sort the sections on the repository
  16204. listing by name.
  16205. Defaults to @samp{""}.
  16206. @end deftypevr
  16207. @deftypevr {@code{cgit-configuration} parameter} integer section-from-path
  16208. A number which, if defined prior to repository-directory, specifies how many
  16209. path elements from each repo path to use as a default section name.
  16210. Defaults to @samp{0}.
  16211. @end deftypevr
  16212. @deftypevr {@code{cgit-configuration} parameter} boolean side-by-side-diffs?
  16213. If set to @samp{#t} shows side-by-side diffs instead of unidiffs per
  16214. default.
  16215. Defaults to @samp{#f}.
  16216. @end deftypevr
  16217. @deftypevr {@code{cgit-configuration} parameter} file-object source-filter
  16218. Specifies a command which will be invoked to format plaintext blobs in the
  16219. tree view.
  16220. Defaults to @samp{""}.
  16221. @end deftypevr
  16222. @deftypevr {@code{cgit-configuration} parameter} integer summary-branches
  16223. Specifies the number of branches to display in the repository "summary"
  16224. view.
  16225. Defaults to @samp{10}.
  16226. @end deftypevr
  16227. @deftypevr {@code{cgit-configuration} parameter} integer summary-log
  16228. Specifies the number of log entries to display in the repository "summary"
  16229. view.
  16230. Defaults to @samp{10}.
  16231. @end deftypevr
  16232. @deftypevr {@code{cgit-configuration} parameter} integer summary-tags
  16233. Specifies the number of tags to display in the repository "summary" view.
  16234. Defaults to @samp{10}.
  16235. @end deftypevr
  16236. @deftypevr {@code{cgit-configuration} parameter} string strict-export
  16237. Filename which, if specified, needs to be present within the repository for
  16238. cgit to allow access to that repository.
  16239. Defaults to @samp{""}.
  16240. @end deftypevr
  16241. @deftypevr {@code{cgit-configuration} parameter} string virtual-root
  16242. URL which, if specified, will be used as root for all cgit links.
  16243. Defaults to @samp{"/"}.
  16244. @end deftypevr
  16245. @deftypevr {@code{cgit-configuration} parameter} repository-cgit-configuration-list repositories
  16246. A list of @dfn{cgit-repo} records to use with config.
  16247. Defaults to @samp{()}.
  16248. Available @code{repository-cgit-configuration} fields are:
  16249. @deftypevr {@code{repository-cgit-configuration} parameter} repo-list snapshots
  16250. A mask of snapshot formats for this repo that cgit generates links for,
  16251. restricted by the global @code{snapshots} setting.
  16252. Defaults to @samp{()}.
  16253. @end deftypevr
  16254. @deftypevr {@code{repository-cgit-configuration} parameter} repo-file-object source-filter
  16255. Override the default @code{source-filter}.
  16256. Defaults to @samp{""}.
  16257. @end deftypevr
  16258. @deftypevr {@code{repository-cgit-configuration} parameter} repo-string url
  16259. The relative URL used to access the repository.
  16260. Defaults to @samp{""}.
  16261. @end deftypevr
  16262. @deftypevr {@code{repository-cgit-configuration} parameter} repo-file-object about-filter
  16263. Override the default @code{about-filter}.
  16264. Defaults to @samp{""}.
  16265. @end deftypevr
  16266. @deftypevr {@code{repository-cgit-configuration} parameter} repo-string branch-sort
  16267. Flag which, when set to @samp{age}, enables date ordering in the branch ref
  16268. list, and when set to @samp{name} enables ordering by branch name.
  16269. Defaults to @samp{""}.
  16270. @end deftypevr
  16271. @deftypevr {@code{repository-cgit-configuration} parameter} repo-list clone-url
  16272. A list of URLs which can be used to clone repo.
  16273. Defaults to @samp{()}.
  16274. @end deftypevr
  16275. @deftypevr {@code{repository-cgit-configuration} parameter} repo-file-object commit-filter
  16276. Override the default @code{commit-filter}.
  16277. Defaults to @samp{""}.
  16278. @end deftypevr
  16279. @deftypevr {@code{repository-cgit-configuration} parameter} repo-string commit-sort
  16280. Flag which, when set to @samp{date}, enables strict date ordering in the
  16281. commit log, and when set to @samp{topo} enables strict topological ordering.
  16282. Defaults to @samp{""}.
  16283. @end deftypevr
  16284. @deftypevr {@code{repository-cgit-configuration} parameter} repo-string defbranch
  16285. The name of the default branch for this repository. If no such branch
  16286. exists in the repository, the first branch name (when sorted) is used as
  16287. default instead. By default branch pointed to by HEAD, or "master" if there
  16288. is no suitable HEAD.
  16289. Defaults to @samp{""}.
  16290. @end deftypevr
  16291. @deftypevr {@code{repository-cgit-configuration} parameter} repo-string desc
  16292. The value to show as repository description.
  16293. Defaults to @samp{""}.
  16294. @end deftypevr
  16295. @deftypevr {@code{repository-cgit-configuration} parameter} repo-string homepage
  16296. The value to show as repository homepage.
  16297. Defaults to @samp{""}.
  16298. @end deftypevr
  16299. @deftypevr {@code{repository-cgit-configuration} parameter} repo-file-object email-filter
  16300. Override the default @code{email-filter}.
  16301. Defaults to @samp{""}.
  16302. @end deftypevr
  16303. @deftypevr {@code{repository-cgit-configuration} parameter} maybe-repo-boolean enable-commit-graph?
  16304. A flag which can be used to disable the global setting
  16305. @code{enable-commit-graph?}.
  16306. Defaults to @samp{disabled}.
  16307. @end deftypevr
  16308. @deftypevr {@code{repository-cgit-configuration} parameter} maybe-repo-boolean enable-log-filecount?
  16309. A flag which can be used to disable the global setting
  16310. @code{enable-log-filecount?}.
  16311. Defaults to @samp{disabled}.
  16312. @end deftypevr
  16313. @deftypevr {@code{repository-cgit-configuration} parameter} maybe-repo-boolean enable-log-linecount?
  16314. A flag which can be used to disable the global setting
  16315. @code{enable-log-linecount?}.
  16316. Defaults to @samp{disabled}.
  16317. @end deftypevr
  16318. @deftypevr {@code{repository-cgit-configuration} parameter} maybe-repo-boolean enable-remote-branches?
  16319. Flag which, when set to @code{#t}, will make cgit display remote branches in
  16320. the summary and refs views.
  16321. Defaults to @samp{disabled}.
  16322. @end deftypevr
  16323. @deftypevr {@code{repository-cgit-configuration} parameter} maybe-repo-boolean enable-subject-links?
  16324. A flag which can be used to override the global setting
  16325. @code{enable-subject-links?}.
  16326. Defaults to @samp{disabled}.
  16327. @end deftypevr
  16328. @deftypevr {@code{repository-cgit-configuration} parameter} maybe-repo-boolean enable-html-serving?
  16329. A flag which can be used to override the global setting
  16330. @code{enable-html-serving?}.
  16331. Defaults to @samp{disabled}.
  16332. @end deftypevr
  16333. @deftypevr {@code{repository-cgit-configuration} parameter} repo-boolean hide?
  16334. Flag which, when set to @code{#t}, hides the repository from the repository
  16335. index.
  16336. Defaults to @samp{#f}.
  16337. @end deftypevr
  16338. @deftypevr {@code{repository-cgit-configuration} parameter} repo-boolean ignore?
  16339. Flag which, when set to @samp{#t}, ignores the repository.
  16340. Defaults to @samp{#f}.
  16341. @end deftypevr
  16342. @deftypevr {@code{repository-cgit-configuration} parameter} repo-file-object logo
  16343. URL which specifies the source of an image which will be used as a logo on
  16344. this repo’s pages.
  16345. Defaults to @samp{""}.
  16346. @end deftypevr
  16347. @deftypevr {@code{repository-cgit-configuration} parameter} repo-string logo-link
  16348. URL loaded when clicking on the cgit logo image.
  16349. Defaults to @samp{""}.
  16350. @end deftypevr
  16351. @deftypevr {@code{repository-cgit-configuration} parameter} repo-file-object owner-filter
  16352. Override the default @code{owner-filter}.
  16353. Defaults to @samp{""}.
  16354. @end deftypevr
  16355. @deftypevr {@code{repository-cgit-configuration} parameter} repo-string module-link
  16356. Text which will be used as the formatstring for a hyperlink when a submodule
  16357. is printed in a directory listing. The arguments for the formatstring are
  16358. the path and SHA1 of the submodule commit.
  16359. Defaults to @samp{""}.
  16360. @end deftypevr
  16361. @deftypevr {@code{repository-cgit-configuration} parameter} module-link-path module-link-path
  16362. Text which will be used as the formatstring for a hyperlink when a submodule
  16363. with the specified subdirectory path is printed in a directory listing.
  16364. Defaults to @samp{()}.
  16365. @end deftypevr
  16366. @deftypevr {@code{repository-cgit-configuration} parameter} repo-string max-stats
  16367. Override the default maximum statistics period.
  16368. Defaults to @samp{""}.
  16369. @end deftypevr
  16370. @deftypevr {@code{repository-cgit-configuration} parameter} repo-string name
  16371. The value to show as repository name.
  16372. Defaults to @samp{""}.
  16373. @end deftypevr
  16374. @deftypevr {@code{repository-cgit-configuration} parameter} repo-string owner
  16375. A value used to identify the owner of the repository.
  16376. Defaults to @samp{""}.
  16377. @end deftypevr
  16378. @deftypevr {@code{repository-cgit-configuration} parameter} repo-string path
  16379. An absolute path to the repository directory.
  16380. Defaults to @samp{""}.
  16381. @end deftypevr
  16382. @deftypevr {@code{repository-cgit-configuration} parameter} repo-string readme
  16383. A path (relative to repo) which specifies a file to include verbatim as the
  16384. "About" page for this repo.
  16385. Defaults to @samp{""}.
  16386. @end deftypevr
  16387. @deftypevr {@code{repository-cgit-configuration} parameter} repo-string section
  16388. The name of the current repository section - all repositories defined after
  16389. this option will inherit the current section name.
  16390. Defaults to @samp{""}.
  16391. @end deftypevr
  16392. @deftypevr {@code{repository-cgit-configuration} parameter} repo-list extra-options
  16393. Extra options will be appended to cgitrc file.
  16394. Defaults to @samp{()}.
  16395. @end deftypevr
  16396. @end deftypevr
  16397. @deftypevr {@code{cgit-configuration} parameter} list extra-options
  16398. Extra options will be appended to cgitrc file.
  16399. Defaults to @samp{()}.
  16400. @end deftypevr
  16401. @c %end of fragment
  16402. However, it could be that you just want to get a @code{cgitrc} up and
  16403. running. In that case, you can pass an @code{opaque-cgit-configuration} as
  16404. a record to @code{cgit-service-type}. As its name indicates, an opaque
  16405. configuration does not have easy reflective capabilities.
  16406. Available @code{opaque-cgit-configuration} fields are:
  16407. @deftypevr {@code{opaque-cgit-configuration} parameter} package cgit
  16408. The cgit package.
  16409. @end deftypevr
  16410. @deftypevr {@code{opaque-cgit-configuration} parameter} string string
  16411. The contents of the @code{cgitrc}, as a string.
  16412. @end deftypevr
  16413. For example, if your @code{cgitrc} is just the empty string, you could
  16414. instantiate a cgit service like this:
  16415. @example
  16416. (service cgit-service-type
  16417. (opaque-cgit-configuration
  16418. (cgitrc "")))
  16419. @end example
  16420. @subsubheading Gitolite Service
  16421. @cindex Gitolite service
  16422. @cindex Git, hosting
  16423. @uref{http://gitolite.com/gitolite/, Gitolite} is a tool for hosting Git
  16424. repositories on a central server.
  16425. Gitolite can handle multiple repositories and users, and supports flexible
  16426. configuration of the permissions for the users on the repositories.
  16427. The following example will configure Gitolite using the default @code{git}
  16428. user, and the provided SSH public key.
  16429. @example
  16430. (service gitolite-service-type
  16431. (gitolite-configuration
  16432. (admin-pubkey (plain-file
  16433. "yourname.pub"
  16434. "ssh-rsa AAAA... guix@@example.com"))))
  16435. @end example
  16436. Gitolite is configured through a special admin repository which you can
  16437. clone, for example, if you setup Gitolite on @code{example.com}, you would
  16438. run the following command to clone the admin repository.
  16439. @example
  16440. git clone git@@example.com:gitolite-admin
  16441. @end example
  16442. When the Gitolite service is activated, the provided @code{admin-pubkey}
  16443. will be inserted in to the @file{keydir} directory in the gitolite-admin
  16444. repository. If this results in a change in the repository, it will be
  16445. committed using the message ``gitolite setup by GNU Guix''.
  16446. @deftp {Data Type} gitolite-configuration
  16447. Data type representing the configuration for @code{gitolite-service-type}.
  16448. @table @asis
  16449. @item @code{package} (default: @var{gitolite})
  16450. Gitolite package to use.
  16451. @item @code{user} (default: @var{git})
  16452. User to use for Gitolite. This will be user that you use when accessing
  16453. Gitolite over SSH.
  16454. @item @code{group} (default: @var{git})
  16455. Group to use for Gitolite.
  16456. @item @code{home-directory} (default: @var{"/var/lib/gitolite"})
  16457. Directory in which to store the Gitolite configuration and repositories.
  16458. @item @code{rc-file} (default: @var{(gitolite-rc-file)})
  16459. A ``file-like'' object (@pxref{G-Ausdrücke, file-like objects}),
  16460. representing the configuration for Gitolite.
  16461. @item @code{admin-pubkey} (default: @var{#f})
  16462. A ``file-like'' object (@pxref{G-Ausdrücke, file-like objects}) used to
  16463. setup Gitolite. This will be inserted in to the @file{keydir} directory
  16464. within the gitolite-admin repository.
  16465. To specify the SSH key as a string, use the @code{plain-file} function.
  16466. @example
  16467. (plain-file "yourname.pub" "ssh-rsa AAAA... guix@@example.com")
  16468. @end example
  16469. @end table
  16470. @end deftp
  16471. @deftp {Data Type} gitolite-rc-file
  16472. Data type representing the Gitolite RC file.
  16473. @table @asis
  16474. @item @code{umask} (default: @code{#o0077})
  16475. This controls the permissions Gitolite sets on the repositories and their
  16476. contents.
  16477. A value like @code{#o0027} will give read access to the group used by
  16478. Gitolite (by default: @code{git}). This is necessary when using Gitolite
  16479. with software like cgit or gitweb.
  16480. @item @code{git-config-keys} (default: @code{""})
  16481. Gitolite allows you to set git config values using the "config"
  16482. keyword. This setting allows control over the config keys to accept.
  16483. @item @code{roles} (default: @code{'(("READERS" . 1) ("WRITERS" . ))})
  16484. Set the role names allowed to be used by users running the perms command.
  16485. @item @code{enable} (default: @code{'("help" "desc" "info" "perms" "writable" "ssh-authkeys" "git-config" "daemon" "gitweb")})
  16486. This setting controls the commands and features to enable within Gitolite.
  16487. @end table
  16488. @end deftp
  16489. @node Spieldienste
  16490. @subsubsection Spieldienste
  16491. @subsubheading The Battle for Wesnoth Service
  16492. @cindex wesnothd
  16493. @uref{https://wesnoth.org, The Battle for Wesnoth} is a fantasy, turn based
  16494. tactical strategy game, with several single player campaigns, and
  16495. multiplayer games (both networked and local).
  16496. @defvar {Scheme Variable} wesnothd-service-type
  16497. Service type for the wesnothd service. Its value must be a
  16498. @code{wesnothd-configuration} object. To run wesnothd in the default
  16499. configuration, instantiate it as:
  16500. @example
  16501. (service wesnothd-service-type)
  16502. @end example
  16503. @end defvar
  16504. @deftp {Data Type} wesnothd-configuration
  16505. Data type representing the configuration of @command{wesnothd}.
  16506. @table @asis
  16507. @item @code{package} (default: @code{wesnoth-server})
  16508. The wesnoth server package to use.
  16509. @item @code{port} (default: @code{15000})
  16510. The port to bind the server to.
  16511. @end table
  16512. @end deftp
  16513. @node Verschiedene Dienste
  16514. @subsubsection Verschiedene Dienste
  16515. @cindex fingerprint
  16516. @subsubheading Fingerprint Service
  16517. The @code{(gnu services fingerprint)} module provides a DBus service to read
  16518. and identify fingerprints via a fingerprint sensor.
  16519. @defvr {Scheme Variable} fprintd-service-type
  16520. The service type for @command{fprintd}, which provides the fingerprint
  16521. reading capability.
  16522. @example
  16523. (service fprintd-service-type)
  16524. @end example
  16525. @end defvr
  16526. @cindex sysctl
  16527. @subsubheading System Control Service
  16528. The @code{(gnu services sysctl)} provides a service to configure kernel
  16529. parameters at boot.
  16530. @defvr {Scheme Variable} sysctl-service-type
  16531. The service type for @command{sysctl}, which modifies kernel parameters
  16532. under @file{/proc/sys/}. To enable IPv4 forwarding, it can be instantiated
  16533. as:
  16534. @example
  16535. (service sysctl-service-type
  16536. (sysctl-configuration
  16537. (settings '(("net.ipv4.ip_forward" . "1")))))
  16538. @end example
  16539. @end defvr
  16540. @deftp {Data Type} sysctl-configuration
  16541. The data type representing the configuration of @command{sysctl}.
  16542. @table @asis
  16543. @item @code{sysctl} (default: @code{(file-append procps "/sbin/sysctl"})
  16544. The @command{sysctl} executable to use.
  16545. @item @code{settings} (default: @code{'()})
  16546. An association list specifies kernel parameters and their values.
  16547. @end table
  16548. @end deftp
  16549. @cindex pcscd
  16550. @subsubheading PC/SC Smart Card Daemon Service
  16551. The @code{(gnu services security-token)} module provides the following
  16552. service to run @command{pcscd}, the PC/SC Smart Card Daemon.
  16553. @command{pcscd} is the daemon program for pcsc-lite and the MuscleCard
  16554. framework. It is a resource manager that coordinates communications with
  16555. smart card readers, smart cards and cryptographic tokens that are connected
  16556. to the system.
  16557. @defvr {Scheme Variable} pcscd-service-type
  16558. Service type for the @command{pcscd} service. Its value must be a
  16559. @code{pcscd-configuration} object. To run pcscd in the default
  16560. configuration, instantiate it as:
  16561. @example
  16562. (service pcscd-service-type)
  16563. @end example
  16564. @end defvr
  16565. @deftp {Data Type} pcscd-configuration
  16566. The data type representing the configuration of @command{pcscd}.
  16567. @table @asis
  16568. @item @code{pcsc-lite} (default: @code{pcsc-lite})
  16569. The pcsc-lite package that provides pcscd.
  16570. @item @code{usb-drivers} (default: @code{(list ccid)})
  16571. List of packages that provide USB drivers to pcscd. Drivers are expected to
  16572. be under @file{pcsc/drivers} in the store directory of the package.
  16573. @end table
  16574. @end deftp
  16575. @cindex lirc
  16576. @subsubheading Lirc Service
  16577. The @code{(gnu services lirc)} module provides the following service.
  16578. @deffn {Scheme Procedure} lirc-service [#:lirc lirc] @
  16579. [#:device #f] [#:driver #f] [#:config-file #f] @ [#:extra-options '()]
  16580. Return a service that runs @url{http://www.lirc.org,LIRC}, a daemon that
  16581. decodes infrared signals from remote controls.
  16582. Optionally, @var{device}, @var{driver} and @var{config-file} (configuration
  16583. file name) may be specified. See @command{lircd} manual for details.
  16584. Finally, @var{extra-options} is a list of additional command-line options
  16585. passed to @command{lircd}.
  16586. @end deffn
  16587. @cindex spice
  16588. @subsubheading Spice Service
  16589. The @code{(gnu services spice)} module provides the following service.
  16590. @deffn {Scheme Procedure} spice-vdagent-service [#:spice-vdagent]
  16591. Returns a service that runs @url{http://www.spice-space.org,VDAGENT}, a
  16592. daemon that enables sharing the clipboard with a vm and setting the guest
  16593. display resolution when the graphical console window resizes.
  16594. @end deffn
  16595. @subsubsection Dictionary Services
  16596. @cindex dictionary
  16597. The @code{(gnu services dict)} module provides the following service:
  16598. @deffn {Scheme Procedure} dicod-service [#:config (dicod-configuration)]
  16599. Return a service that runs the @command{dicod} daemon, an implementation of
  16600. DICT server (@pxref{Dicod,,, dico, GNU Dico Manual}).
  16601. The optional @var{config} argument specifies the configuration for
  16602. @command{dicod}, which should be a @code{<dicod-configuration>} object, by
  16603. default it serves the GNU Collaborative International Dictonary of English.
  16604. You can add @command{open localhost} to your @file{~/.dico} file to make
  16605. @code{localhost} the default server for @command{dico} client
  16606. (@pxref{Initialization File,,, dico, GNU Dico Manual}).
  16607. @end deffn
  16608. @deftp {Data Type} dicod-configuration
  16609. Data type representing the configuration of dicod.
  16610. @table @asis
  16611. @item @code{dico} (default: @var{dico})
  16612. Package object of the GNU Dico dictionary server.
  16613. @item @code{interfaces} (default: @var{'("localhost")})
  16614. This is the list of IP addresses and ports and possibly socket file names to
  16615. listen to (@pxref{Server Settings, @code{listen} directive,, dico, GNU Dico
  16616. Manual}).
  16617. @item @code{handlers} (default: @var{'()})
  16618. List of @code{<dicod-handler>} objects denoting handlers (module instances).
  16619. @item @code{databases} (default: @var{(list %dicod-database:gcide)})
  16620. List of @code{<dicod-database>} objects denoting dictionaries to be served.
  16621. @end table
  16622. @end deftp
  16623. @deftp {Data Type} dicod-handler
  16624. Data type representing a dictionary handler (module instance).
  16625. @table @asis
  16626. @item @code{name}
  16627. Name of the handler (module instance).
  16628. @item @code{module} (default: @var{#f})
  16629. Name of the dicod module of the handler (instance). If it is @code{#f}, the
  16630. module has the same name as the handler. (@pxref{Module,,, dico, GNU Dico
  16631. Manual}).
  16632. @item @code{options}
  16633. List of strings or gexps representing the arguments for the module handler
  16634. @end table
  16635. @end deftp
  16636. @deftp {Data Type} dicod-database
  16637. Data type representing a dictionary database.
  16638. @table @asis
  16639. @item @code{name}
  16640. Name of the database, will be used in DICT commands.
  16641. @item @code{handler}
  16642. Name of the dicod handler (module instance) used by this database
  16643. (@pxref{Handlers,,, dico, GNU Dico Manual}).
  16644. @item @code{complex?} (default: @var{#f})
  16645. Whether the database configuration complex. The complex configuration will
  16646. need a corresponding @code{<dicod-handler>} object, otherwise not.
  16647. @item @code{options}
  16648. List of strings or gexps representing the arguments for the database
  16649. (@pxref{Databases,,, dico, GNU Dico Manual}).
  16650. @end table
  16651. @end deftp
  16652. @defvr {Scheme Variable} %dicod-database:gcide
  16653. A @code{<dicod-database>} object serving the GNU Collaborative International
  16654. Dictionary of English using the @code{gcide} package.
  16655. @end defvr
  16656. The following is an example @code{dicod-service} configuration.
  16657. @example
  16658. (dicod-service #:config
  16659. (dicod-configuration
  16660. (handlers (list (dicod-handler
  16661. (name "wordnet")
  16662. (module "dictorg")
  16663. (options
  16664. (list #~(string-append "dbdir=" #$wordnet))))))
  16665. (databases (list (dicod-database
  16666. (name "wordnet")
  16667. (complex? #t)
  16668. (handler "wordnet")
  16669. (options '("database=wn")))
  16670. %dicod-database:gcide))))
  16671. @end example
  16672. @node Setuid-Programme
  16673. @subsection Setuid-Programme
  16674. @cindex setuid programs
  16675. Some programs need to run with ``root'' privileges, even when they are
  16676. launched by unprivileged users. A notorious example is the @command{passwd}
  16677. program, which users can run to change their password, and which needs to
  16678. access the @file{/etc/passwd} and @file{/etc/shadow} files---something
  16679. normally restricted to root, for obvious security reasons. To address that,
  16680. these executables are @dfn{setuid-root}, meaning that they always run with
  16681. root privileges (@pxref{How Change Persona,,, libc, The GNU C Library
  16682. Reference Manual}, for more info about the setuid mechanism.)
  16683. The store itself @emph{cannot} contain setuid programs: that would be a
  16684. security issue since any user on the system can write derivations that
  16685. populate the store (@pxref{Der Store}). Thus, a different mechanism is
  16686. used: instead of changing the setuid bit directly on files that are in the
  16687. store, we let the system administrator @emph{declare} which programs should
  16688. be setuid root.
  16689. The @code{setuid-programs} field of an @code{operating-system} declaration
  16690. contains a list of G-expressions denoting the names of programs to be
  16691. setuid-root (@pxref{Das Konfigurationssystem nutzen}). For instance, the
  16692. @command{passwd} program, which is part of the Shadow package, can be
  16693. designated by this G-expression (@pxref{G-Ausdrücke}):
  16694. @example
  16695. #~(string-append #$shadow "/bin/passwd")
  16696. @end example
  16697. A default set of setuid programs is defined by the @code{%setuid-programs}
  16698. variable of the @code{(gnu system)} module.
  16699. @defvr {Scheme Variable} %setuid-programs
  16700. A list of G-expressions denoting common programs that are setuid-root.
  16701. The list includes commands such as @command{passwd}, @command{ping},
  16702. @command{su}, and @command{sudo}.
  16703. @end defvr
  16704. Under the hood, the actual setuid programs are created in the
  16705. @file{/run/setuid-programs} directory at system activation time. The files
  16706. in this directory refer to the ``real'' binaries, which are in the store.
  16707. @node X.509-Zertifikate
  16708. @subsection X.509-Zertifikate
  16709. @cindex HTTPS, certificates
  16710. @cindex X.509 certificates
  16711. @cindex TLS
  16712. Web servers available over HTTPS (that is, HTTP over the transport-layer
  16713. security mechanism, TLS) send client programs an @dfn{X.509 certificate}
  16714. that the client can then use to @emph{authenticate} the server. To do that,
  16715. clients verify that the server's certificate is signed by a so-called
  16716. @dfn{certificate authority} (CA). But to verify the CA's signature, clients
  16717. must have first acquired the CA's certificate.
  16718. Web browsers such as GNU@tie{}IceCat include their own set of CA
  16719. certificates, such that they are able to verify CA signatures
  16720. out-of-the-box.
  16721. However, most other programs that can talk HTTPS---@command{wget},
  16722. @command{git}, @command{w3m}, etc.---need to be told where CA certificates
  16723. can be found.
  16724. @cindex @code{nss-certs}
  16725. In GuixSD, this is done by adding a package that provides certificates to
  16726. the @code{packages} field of the @code{operating-system} declaration
  16727. (@pxref{„operating-system“-Referenz}). GuixSD includes one such package,
  16728. @code{nss-certs}, which is a set of CA certificates provided as part of
  16729. Mozilla's Network Security Services.
  16730. Note that it is @emph{not} part of @var{%base-packages}, so you need to
  16731. explicitly add it. The @file{/etc/ssl/certs} directory, which is where most
  16732. applications and libraries look for certificates by default, points to the
  16733. certificates installed globally.
  16734. Unprivileged users, including users of Guix on a foreign distro, can also
  16735. install their own certificate package in their profile. A number of
  16736. environment variables need to be defined so that applications and libraries
  16737. know where to find them. Namely, the OpenSSL library honors the
  16738. @code{SSL_CERT_DIR} and @code{SSL_CERT_FILE} variables. Some applications
  16739. add their own environment variables; for instance, the Git version control
  16740. system honors the certificate bundle pointed to by the @code{GIT_SSL_CAINFO}
  16741. environment variable. Thus, you would typically run something like:
  16742. @example
  16743. $ guix package -i nss-certs
  16744. $ export SSL_CERT_DIR="$HOME/.guix-profile/etc/ssl/certs"
  16745. $ export SSL_CERT_FILE="$HOME/.guix-profile/etc/ssl/certs/ca-certificates.crt"
  16746. $ export GIT_SSL_CAINFO="$SSL_CERT_FILE"
  16747. @end example
  16748. As another example, R requires the @code{CURL_CA_BUNDLE} environment
  16749. variable to point to a certificate bundle, so you would have to run
  16750. something like this:
  16751. @example
  16752. $ guix package -i nss-certs
  16753. $ export CURL_CA_BUNDLE="$HOME/.guix-profile/etc/ssl/certs/ca-certificates.crt"
  16754. @end example
  16755. For other applications you may want to look up the required environment
  16756. variable in the relevant documentation.
  16757. @node Name Service Switch
  16758. @subsection Name Service Switch
  16759. @cindex name service switch
  16760. @cindex NSS
  16761. The @code{(gnu system nss)} module provides bindings to the configuration
  16762. file of the libc @dfn{name service switch} or @dfn{NSS} (@pxref{NSS
  16763. Configuration File,,, libc, The GNU C Library Reference Manual}). In a
  16764. nutshell, the NSS is a mechanism that allows libc to be extended with new
  16765. ``name'' lookup methods for system databases, which includes host names,
  16766. service names, user accounts, and more (@pxref{Name Service Switch, System
  16767. Databases and Name Service Switch,, libc, The GNU C Library Reference
  16768. Manual}).
  16769. The NSS configuration specifies, for each system database, which lookup
  16770. method is to be used, and how the various methods are chained together---for
  16771. instance, under which circumstances NSS should try the next method in the
  16772. list. The NSS configuration is given in the @code{name-service-switch}
  16773. field of @code{operating-system} declarations (@pxref{„operating-system“-Referenz, @code{name-service-switch}}).
  16774. @cindex nss-mdns
  16775. @cindex .local, host name lookup
  16776. As an example, the declaration below configures the NSS to use the
  16777. @uref{http://0pointer.de/lennart/projects/nss-mdns/, @code{nss-mdns}
  16778. back-end}, which supports host name lookups over multicast DNS (mDNS) for
  16779. host names ending in @code{.local}:
  16780. @example
  16781. (name-service-switch
  16782. (hosts (list %files ;first, check /etc/hosts
  16783. ;; If the above did not succeed, try
  16784. ;; with 'mdns_minimal'.
  16785. (name-service
  16786. (name "mdns_minimal")
  16787. ;; 'mdns_minimal' is authoritative for
  16788. ;; '.local'. When it returns "not found",
  16789. ;; no need to try the next methods.
  16790. (reaction (lookup-specification
  16791. (not-found => return))))
  16792. ;; Then fall back to DNS.
  16793. (name-service
  16794. (name "dns"))
  16795. ;; Finally, try with the "full" 'mdns'.
  16796. (name-service
  16797. (name "mdns")))))
  16798. @end example
  16799. Do not worry: the @code{%mdns-host-lookup-nss} variable (see below)
  16800. contains this configuration, so you will not have to type it if all you want
  16801. is to have @code{.local} host lookup working.
  16802. Note that, in this case, in addition to setting the
  16803. @code{name-service-switch} of the @code{operating-system} declaration, you
  16804. also need to use @code{avahi-service} (@pxref{Netzwerkdienste,
  16805. @code{avahi-service}}), or @var{%desktop-services}, which includes it
  16806. (@pxref{Desktop-Dienste}). Doing this makes @code{nss-mdns} accessible to
  16807. the name service cache daemon (@pxref{Basisdienste, @code{nscd-service}}).
  16808. For convenience, the following variables provide typical NSS configurations.
  16809. @defvr {Scheme Variable} %default-nss
  16810. This is the default name service switch configuration, a
  16811. @code{name-service-switch} object.
  16812. @end defvr
  16813. @defvr {Scheme Variable} %mdns-host-lookup-nss
  16814. This is the name service switch configuration with support for host name
  16815. lookup over multicast DNS (mDNS) for host names ending in @code{.local}.
  16816. @end defvr
  16817. The reference for name service switch configuration is given below. It is a
  16818. direct mapping of the configuration file format of the C library , so please
  16819. refer to the C library manual for more information (@pxref{NSS Configuration
  16820. File,,, libc, The GNU C Library Reference Manual}). Compared to the
  16821. configuration file format of libc NSS, it has the advantage not only of
  16822. adding this warm parenthetic feel that we like, but also static checks: you
  16823. will know about syntax errors and typos as soon as you run @command{guix
  16824. system}.
  16825. @deftp {Data Type} name-service-switch
  16826. This is the data type representation the configuration of libc's name
  16827. service switch (NSS). Each field below represents one of the supported
  16828. system databases.
  16829. @table @code
  16830. @item aliases
  16831. @itemx ethers
  16832. @itemx group
  16833. @itemx gshadow
  16834. @itemx hosts
  16835. @itemx initgroups
  16836. @itemx netgroup
  16837. @itemx networks
  16838. @itemx password
  16839. @itemx public-key
  16840. @itemx rpc
  16841. @itemx services
  16842. @itemx shadow
  16843. The system databases handled by the NSS. Each of these fields must be a
  16844. list of @code{<name-service>} objects (see below).
  16845. @end table
  16846. @end deftp
  16847. @deftp {Data Type} name-service
  16848. This is the data type representing an actual name service and the associated
  16849. lookup action.
  16850. @table @code
  16851. @item name
  16852. A string denoting the name service (@pxref{Services in the NSS
  16853. configuration,,, libc, The GNU C Library Reference Manual}).
  16854. Note that name services listed here must be visible to nscd. This is
  16855. achieved by passing the @code{#:name-services} argument to
  16856. @code{nscd-service} the list of packages providing the needed name services
  16857. (@pxref{Basisdienste, @code{nscd-service}}).
  16858. @item reaction
  16859. An action specified using the @code{lookup-specification} macro
  16860. (@pxref{Actions in the NSS configuration,,, libc, The GNU C Library
  16861. Reference Manual}). For example:
  16862. @example
  16863. (lookup-specification (unavailable => continue)
  16864. (success => return))
  16865. @end example
  16866. @end table
  16867. @end deftp
  16868. @node Initiale RAM-Disk
  16869. @subsection Initiale RAM-Disk
  16870. @cindex initrd
  16871. @cindex initial RAM disk
  16872. For bootstrapping purposes, the Linux-Libre kernel is passed an @dfn{initial
  16873. RAM disk}, or @dfn{initrd}. An initrd contains a temporary root file system
  16874. as well as an initialization script. The latter is responsible for mounting
  16875. the real root file system, and for loading any kernel modules that may be
  16876. needed to achieve that.
  16877. The @code{initrd-modules} field of an @code{operating-system} declaration
  16878. allows you to specify Linux-libre kernel modules that must be available in
  16879. the initrd. In particular, this is where you would list modules needed to
  16880. actually drive the hard disk where your root partition is---although the
  16881. default value of @code{initrd-modules} should cover most use cases. For
  16882. example, assuming you need the @code{megaraid_sas} module in addition to the
  16883. default modules to be able to access your root file system, you would write:
  16884. @example
  16885. (operating-system
  16886. ;; @dots{}
  16887. (initrd-modules (cons "megaraid_sas" %base-initrd-modules)))
  16888. @end example
  16889. @defvr {Scheme Variable} %base-initrd-modules
  16890. This is the list of kernel modules included in the initrd by default.
  16891. @end defvr
  16892. Furthermore, if you need lower-level customization, the @code{initrd} field
  16893. of an @code{operating-system} declaration allows you to specify which initrd
  16894. you would like to use. The @code{(gnu system linux-initrd)} module provides
  16895. three ways to build an initrd: the high-level @code{base-initrd} procedure
  16896. and the low-level @code{raw-initrd} and @code{expression->initrd}
  16897. procedures.
  16898. The @code{base-initrd} procedure is intended to cover most common uses. For
  16899. example, if you want to add a bunch of kernel modules to be loaded at boot
  16900. time, you can define the @code{initrd} field of the operating system
  16901. declaration like this:
  16902. @example
  16903. (initrd (lambda (file-systems . rest)
  16904. ;; Create a standard initrd but set up networking
  16905. ;; with the parameters QEMU expects by default.
  16906. (apply base-initrd file-systems
  16907. #:qemu-networking? #t
  16908. rest)))
  16909. @end example
  16910. The @code{base-initrd} procedure also handles common use cases that involves
  16911. using the system as a QEMU guest, or as a ``live'' system with volatile root
  16912. file system.
  16913. The @code{base-initrd} procedure is built from @code{raw-initrd} procedure.
  16914. Unlike @code{base-initrd}, @code{raw-initrd} doesn't do anything high-level,
  16915. such as trying to guess which kernel modules and packages should be included
  16916. to the initrd. An example use of @code{raw-initrd} is when a user has a
  16917. custom Linux kernel configuration and default kernel modules included by
  16918. @code{base-initrd} are not available.
  16919. The initial RAM disk produced by @code{base-initrd} or @code{raw-initrd}
  16920. honors several options passed on the Linux kernel command line (that is,
  16921. arguments passed @i{via} the @code{linux} command of GRUB, or the
  16922. @code{-append} option of QEMU), notably:
  16923. @table @code
  16924. @item --load=@var{boot}
  16925. Tell the initial RAM disk to load @var{boot}, a file containing a Scheme
  16926. program, once it has mounted the root file system.
  16927. GuixSD uses this option to yield control to a boot program that runs the
  16928. service activation programs and then spawns the GNU@tie{}Shepherd, the
  16929. initialization system.
  16930. @item --root=@var{root}
  16931. Mount @var{root} as the root file system. @var{root} can be a device name
  16932. like @code{/dev/sda1}, a file system label, or a file system UUID.
  16933. @item --system=@var{System}
  16934. Have @file{/run/booted-system} and @file{/run/current-system} point to
  16935. @var{system}.
  16936. @item modprobe.blacklist=@var{modules}@dots{}
  16937. @cindex module, black-listing
  16938. @cindex black list, of kernel modules
  16939. Instruct the initial RAM disk as well as the @command{modprobe} command
  16940. (from the kmod package) to refuse to load @var{modules}. @var{modules} must
  16941. be a comma-separated list of module names---e.g., @code{usbkbd,9pnet}.
  16942. @item --repl
  16943. Start a read-eval-print loop (REPL) from the initial RAM disk before it
  16944. tries to load kernel modules and to mount the root file system. Our
  16945. marketing team calls it @dfn{boot-to-Guile}. The Schemer in you will love
  16946. it. @xref{Using Guile Interactively,,, guile, GNU Guile Reference Manual},
  16947. for more information on Guile's REPL.
  16948. @end table
  16949. Now that you know all the features that initial RAM disks produced by
  16950. @code{base-initrd} and @code{raw-initrd} provide, here is how to use it and
  16951. customize it further.
  16952. @cindex initrd
  16953. @cindex initial RAM disk
  16954. @deffn {Scheme Procedure} raw-initrd @var{file-systems} @
  16955. [#:linux-modules '()] [#:mapped-devices '()] @ [#:helper-packages '()]
  16956. [#:qemu-networking? #f] [#:volatile-root? #f] Return a derivation that
  16957. builds a raw initrd. @var{file-systems} is a list of file systems to be
  16958. mounted by the initrd, possibly in addition to the root file system
  16959. specified on the kernel command line via @code{--root}. @var{linux-modules}
  16960. is a list of kernel modules to be loaded at boot time. @var{mapped-devices}
  16961. is a list of device mappings to realize before @var{file-systems} are
  16962. mounted (@pxref{Abgebildete Geräte}). @var{helper-packages} is a list of
  16963. packages to be copied in the initrd. It may include @code{e2fsck/static} or
  16964. other packages needed by the initrd to check the root file system.
  16965. When @var{qemu-networking?} is true, set up networking with the standard
  16966. QEMU parameters. When @var{virtio?} is true, load additional modules so
  16967. that the initrd can be used as a QEMU guest with para-virtualized I/O
  16968. drivers.
  16969. When @var{volatile-root?} is true, the root file system is writable but any
  16970. changes to it are lost.
  16971. @end deffn
  16972. @deffn {Scheme Procedure} base-initrd @var{file-systems} @
  16973. [#:mapped-devices '()] [#:qemu-networking? #f] [#:volatile-root? #f]@
  16974. [#:linux-modules '()] Return as a file-like object a generic initrd, with
  16975. kernel modules taken from @var{linux}. @var{file-systems} is a list of
  16976. file-systems to be mounted by the initrd, possibly in addition to the root
  16977. file system specified on the kernel command line via @code{--root}.
  16978. @var{mapped-devices} is a list of device mappings to realize before
  16979. @var{file-systems} are mounted.
  16980. @var{qemu-networking?} and @var{volatile-root?} behaves as in
  16981. @code{raw-initrd}.
  16982. The initrd is automatically populated with all the kernel modules necessary
  16983. for @var{file-systems} and for the given options. Additional kernel modules
  16984. can be listed in @var{linux-modules}. They will be added to the initrd, and
  16985. loaded at boot time in the order in which they appear.
  16986. @end deffn
  16987. Needless to say, the initrds we produce and use embed a statically-linked
  16988. Guile, and the initialization program is a Guile program. That gives a lot
  16989. of flexibility. The @code{expression->initrd} procedure builds such an
  16990. initrd, given the program to run in that initrd.
  16991. @deffn {Scheme Procedure} expression->initrd @var{exp} @
  16992. [#:guile %guile-static-stripped] [#:name "guile-initrd"] Return as a
  16993. file-like object a Linux initrd (a gzipped cpio archive) containing
  16994. @var{guile} and that evaluates @var{exp}, a G-expression, upon booting. All
  16995. the derivations referenced by @var{exp} are automatically copied to the
  16996. initrd.
  16997. @end deffn
  16998. @node Bootloader-Konfiguration
  16999. @subsection Bootloader-Konfiguration
  17000. @cindex bootloader
  17001. @cindex boot loader
  17002. The operating system supports multiple bootloaders. The bootloader is
  17003. configured using @code{bootloader-configuration} declaration. All the
  17004. fields of this structure are bootloader agnostic except for one field,
  17005. @code{bootloader} that indicates the bootloader to be configured and
  17006. installed.
  17007. Some of the bootloaders do not honor every field of
  17008. @code{bootloader-configuration}. For instance, the extlinux bootloader does
  17009. not support themes and thus ignores the @code{theme} field.
  17010. @deftp {Data Type} bootloader-configuration
  17011. The type of a bootloader configuration declaration.
  17012. @table @asis
  17013. @item @code{bootloader}
  17014. @cindex EFI, bootloader
  17015. @cindex UEFI, bootloader
  17016. @cindex BIOS, bootloader
  17017. The bootloader to use, as a @code{bootloader} object. For now
  17018. @code{grub-bootloader}, @code{grub-efi-bootloader},
  17019. @code{extlinux-bootloader} and @code{u-boot-bootloader} are supported.
  17020. @vindex grub-efi-bootloader
  17021. @code{grub-efi-bootloader} allows to boot on modern systems using the
  17022. @dfn{Unified Extensible Firmware Interface} (UEFI). This is what you should
  17023. use if the installation image contains a @file{/sys/firmware/efi} directory
  17024. when you boot it on your system.
  17025. @vindex grub-bootloader
  17026. @code{grub-bootloader} allows you to boot in particular Intel-based machines
  17027. in ``legacy'' BIOS mode.
  17028. @cindex ARM, bootloaders
  17029. @cindex AArch64, bootloaders
  17030. Available bootloaders are described in @code{(gnu bootloader @dots{})}
  17031. modules. In particular, @code{(gnu bootloader u-boot)} contains definitions
  17032. of bootloaders for a wide range of ARM and AArch64 systems, using the
  17033. @uref{http://www.denx.de/wiki/U-Boot/, U-Boot bootloader}.
  17034. @item @code{target}
  17035. This is a string denoting the target onto which to install the bootloader.
  17036. The interpretation depends on the bootloader in question. For
  17037. @code{grub-bootloader}, for example, it should be a device name understood
  17038. by the bootloader @command{installer} command, such as @code{/dev/sda} or
  17039. @code{(hd0)} (@pxref{Invoking grub-install,,, grub, GNU GRUB Manual}). For
  17040. @code{grub-efi-bootloader}, it should be the mount point of the EFI file
  17041. system, usually @file{/boot/efi}.
  17042. @item @code{menu-entries} (default: @code{()})
  17043. A possibly empty list of @code{menu-entry} objects (see below), denoting
  17044. entries to appear in the bootloader menu, in addition to the current system
  17045. entry and the entry pointing to previous system generations.
  17046. @item @code{default-entry} (default: @code{0})
  17047. The index of the default boot menu entry. Index 0 is for the entry of the
  17048. current system.
  17049. @item @code{timeout} (default: @code{5})
  17050. The number of seconds to wait for keyboard input before booting. Set to 0
  17051. to boot immediately, and to -1 to wait indefinitely.
  17052. @item @code{theme} (default: @var{#f})
  17053. The bootloader theme object describing the theme to use. If no theme is
  17054. provided, some bootloaders might use a default theme, that's true for GRUB.
  17055. @item @code{terminal-outputs} (default: @code{'gfxterm})
  17056. The output terminals used for the bootloader boot menu, as a list of
  17057. symbols. GRUB accepts the values: @code{console}, @code{serial},
  17058. @code{serial_@{0-3@}}, @code{gfxterm}, @code{vga_text}, @code{mda_text},
  17059. @code{morse}, and @code{pkmodem}. This field corresponds to the GRUB
  17060. variable @code{GRUB_TERMINAL_OUTPUT} (@pxref{Simple configuration,,,
  17061. grub,GNU GRUB manual}).
  17062. @item @code{terminal-inputs} (default: @code{'()})
  17063. The input terminals used for the bootloader boot menu, as a list of
  17064. symbols. For GRUB, the default is the native platform terminal as
  17065. determined at run-time. GRUB accepts the values: @code{console},
  17066. @code{serial}, @code{serial_@{0-3@}}, @code{at_keyboard}, and
  17067. @code{usb_keyboard}. This field corresponds to the GRUB variable
  17068. @code{GRUB_TERMINAL_INPUT} (@pxref{Simple configuration,,, grub,GNU GRUB
  17069. manual}).
  17070. @item @code{serial-unit} (default: @code{#f})
  17071. The serial unit used by the bootloader, as an integer from 0 to 3. For
  17072. GRUB, it is chosen at run-time; currently GRUB chooses 0, which corresponds
  17073. to COM1 (@pxref{Serial terminal,,, grub,GNU GRUB manual}).
  17074. @item @code{serial-speed} (default: @code{#f})
  17075. The speed of the serial interface, as an integer. For GRUB, the default
  17076. value is chosen at run-time; currently GRUB chooses 9600@tie{}bps
  17077. (@pxref{Serial terminal,,, grub,GNU GRUB manual}).
  17078. @end table
  17079. @end deftp
  17080. @cindex dual boot
  17081. @cindex boot menu
  17082. Should you want to list additional boot menu entries @i{via} the
  17083. @code{menu-entries} field above, you will need to create them with the
  17084. @code{menu-entry} form. For example, imagine you want to be able to boot
  17085. another distro (hard to imagine!), you can define a menu entry along these
  17086. lines:
  17087. @example
  17088. (menu-entry
  17089. (label "The Other Distro")
  17090. (linux "/boot/old/vmlinux-2.6.32")
  17091. (linux-arguments '("root=/dev/sda2"))
  17092. (initrd "/boot/old/initrd"))
  17093. @end example
  17094. Details below.
  17095. @deftp {Data Type} menu-entry
  17096. The type of an entry in the bootloader menu.
  17097. @table @asis
  17098. @item @code{label}
  17099. The label to show in the menu---e.g., @code{"GNU"}.
  17100. @item @code{linux}
  17101. The Linux kernel image to boot, for example:
  17102. @example
  17103. (file-append linux-libre "/bzImage")
  17104. @end example
  17105. For GRUB, it is also possible to specify a device explicitly in the file
  17106. path using GRUB's device naming convention (@pxref{Naming convention,,,
  17107. grub, GNU GRUB manual}), for example:
  17108. @example
  17109. "(hd0,msdos1)/boot/vmlinuz"
  17110. @end example
  17111. If the device is specified explicitly as above, then the @code{device} field
  17112. is ignored entirely.
  17113. @item @code{linux-arguments} (default: @code{()})
  17114. The list of extra Linux kernel command-line arguments---e.g.,
  17115. @code{("console=ttyS0")}.
  17116. @item @code{initrd}
  17117. A G-Expression or string denoting the file name of the initial RAM disk to
  17118. use (@pxref{G-Ausdrücke}).
  17119. @item @code{device} (default: @code{#f})
  17120. The device where the kernel and initrd are to be found---i.e., for GRUB,
  17121. @dfn{root} for this menu entry (@pxref{root,,, grub, GNU GRUB manual}).
  17122. This may be a file system label (a string), a file system UUID (a
  17123. bytevector, @pxref{Dateisysteme}), or @code{#f}, in which case the
  17124. bootloader will search the device containing the file specified by the
  17125. @code{linux} field (@pxref{search,,, grub, GNU GRUB manual}). It must
  17126. @emph{not} be an OS device name such as @file{/dev/sda1}.
  17127. @end table
  17128. @end deftp
  17129. @c FIXME: Write documentation once it's stable.
  17130. Fow now only GRUB has theme support. GRUB themes are created using the
  17131. @code{grub-theme} form, which is not documented yet.
  17132. @defvr {Scheme Variable} %default-theme
  17133. This is the default GRUB theme used by the operating system if no
  17134. @code{theme} field is specified in @code{bootloader-configuration} record.
  17135. It comes with a fancy background image displaying the GNU and Guix logos.
  17136. @end defvr
  17137. @node Aufruf von guix system
  17138. @subsection Invoking @code{guix system}
  17139. Once you have written an operating system declaration as seen in the
  17140. previous section, it can be @dfn{instantiated} using the @command{guix
  17141. system} command. The synopsis is:
  17142. @example
  17143. guix system @var{options}@dots{} @var{action} @var{file}
  17144. @end example
  17145. @var{file} must be the name of a file containing an @code{operating-system}
  17146. declaration. @var{action} specifies how the operating system is
  17147. instantiated. Currently the following values are supported:
  17148. @table @code
  17149. @item search
  17150. Display available service type definitions that match the given regular
  17151. expressions, sorted by relevance:
  17152. @example
  17153. $ guix system search console font
  17154. name: console-fonts
  17155. location: gnu/services/base.scm:729:2
  17156. extends: shepherd-root
  17157. description: Install the given fonts on the specified ttys (fonts are
  17158. + per virtual console on GNU/Linux). The value of this service is a list
  17159. + of tty/font pairs like:
  17160. +
  17161. + '(("tty1" . "LatGrkCyr-8x16"))
  17162. relevance: 20
  17163. name: mingetty
  17164. location: gnu/services/base.scm:1048:2
  17165. extends: shepherd-root
  17166. description: Provide console login using the `mingetty' program.
  17167. relevance: 2
  17168. name: login
  17169. location: gnu/services/base.scm:775:2
  17170. extends: pam
  17171. description: Provide a console log-in service as specified by its
  17172. + configuration value, a `login-configuration' object.
  17173. relevance: 2
  17174. @dots{}
  17175. @end example
  17176. As for @command{guix package --search}, the result is written in
  17177. @code{recutils} format, which makes it easy to filter the output
  17178. (@pxref{Top, GNU recutils databases,, recutils, GNU recutils manual}).
  17179. @item reconfigure
  17180. Build the operating system described in @var{file}, activate it, and switch
  17181. to it@footnote{This action (and the related actions @code{switch-generation}
  17182. and @code{roll-back}) are usable only on systems already running GuixSD.}.
  17183. This effects all the configuration specified in @var{file}: user accounts,
  17184. system services, global package list, setuid programs, etc. The command
  17185. starts system services specified in @var{file} that are not currently
  17186. running; if a service is currently running this command will arrange for it
  17187. to be upgraded the next time it is stopped (e.g.@: by @code{herd stop X} or
  17188. @code{herd restart X}).
  17189. This command creates a new generation whose number is one greater than the
  17190. current generation (as reported by @command{guix system list-generations}).
  17191. If that generation already exists, it will be overwritten. This behavior
  17192. mirrors that of @command{guix package} (@pxref{Aufruf von guix package}).
  17193. It also adds a bootloader menu entry for the new OS configuration, ---unless
  17194. @option{--no-bootloader} is passed. For GRUB, it moves entries for older
  17195. configurations to a submenu, allowing you to choose an older system
  17196. generation at boot time should you need it.
  17197. @quotation Anmerkung
  17198. @c The paragraph below refers to the problem discussed at
  17199. @c <http://lists.gnu.org/archive/html/guix-devel/2014-08/msg00057.html>.
  17200. It is highly recommended to run @command{guix pull} once before you run
  17201. @command{guix system reconfigure} for the first time (@pxref{Aufruf von guix pull}). Failing to do that you would see an older version of Guix once
  17202. @command{reconfigure} has completed.
  17203. @end quotation
  17204. @item switch-generation
  17205. @cindex Generationen
  17206. Switch to an existing system generation. This action atomically switches
  17207. the system profile to the specified system generation. It also rearranges
  17208. the system's existing bootloader menu entries. It makes the menu entry for
  17209. the specified system generation the default, and it moves the entries for
  17210. the other generatiors to a submenu, if supported by the bootloader being
  17211. used. The next time the system boots, it will use the specified system
  17212. generation.
  17213. The bootloader itself is not being reinstalled when using this command.
  17214. Thus, the installed bootloader is used with an updated configuration file.
  17215. The target generation can be specified explicitly by its generation number.
  17216. For example, the following invocation would switch to system generation 7:
  17217. @example
  17218. guix system switch-generation 7
  17219. @end example
  17220. The target generation can also be specified relative to the current
  17221. generation with the form @code{+N} or @code{-N}, where @code{+3} means ``3
  17222. generations ahead of the current generation,'' and @code{-1} means ``1
  17223. generation prior to the current generation.'' When specifying a negative
  17224. value such as @code{-1}, you must precede it with @code{--} to prevent it
  17225. from being parsed as an option. For example:
  17226. @example
  17227. guix system switch-generation -- -1
  17228. @end example
  17229. Currently, the effect of invoking this action is @emph{only} to switch the
  17230. system profile to an existing generation and rearrange the bootloader menu
  17231. entries. To actually start using the target system generation, you must
  17232. reboot after running this action. In the future, it will be updated to do
  17233. the same things as @command{reconfigure}, like activating and deactivating
  17234. services.
  17235. This action will fail if the specified generation does not exist.
  17236. @item roll-back
  17237. @cindex rücksetzen
  17238. Switch to the preceding system generation. The next time the system boots,
  17239. it will use the preceding system generation. This is the inverse of
  17240. @command{reconfigure}, and it is exactly the same as invoking
  17241. @command{switch-generation} with an argument of @code{-1}.
  17242. Currently, as with @command{switch-generation}, you must reboot after
  17243. running this action to actually start using the preceding system generation.
  17244. @item build
  17245. Build the derivation of the operating system, which includes all the
  17246. configuration files and programs needed to boot and run the system. This
  17247. action does not actually install anything.
  17248. @item init
  17249. Populate the given directory with all the files necessary to run the
  17250. operating system specified in @var{file}. This is useful for first-time
  17251. installations of GuixSD. For instance:
  17252. @example
  17253. guix system init my-os-config.scm /mnt
  17254. @end example
  17255. copies to @file{/mnt} all the store items required by the configuration
  17256. specified in @file{my-os-config.scm}. This includes configuration files,
  17257. packages, and so on. It also creates other essential files needed for the
  17258. system to operate correctly---e.g., the @file{/etc}, @file{/var}, and
  17259. @file{/run} directories, and the @file{/bin/sh} file.
  17260. This command also installs bootloader on the target specified in
  17261. @file{my-os-config}, unless the @option{--no-bootloader} option was passed.
  17262. @item vm
  17263. @cindex virtual machine
  17264. @cindex VM
  17265. @anchor{guix system vm}
  17266. Build a virtual machine that contains the operating system declared in
  17267. @var{file}, and return a script to run that virtual machine (VM). Arguments
  17268. given to the script are passed to QEMU as in the example below, which
  17269. enables networking and requests 1@tie{}GiB of RAM for the emulated machine:
  17270. @example
  17271. $ /gnu/store/@dots{}-run-vm.sh -m 1024 -net user
  17272. @end example
  17273. The VM shares its store with the host system.
  17274. Additional file systems can be shared between the host and the VM using the
  17275. @code{--share} and @code{--expose} command-line options: the former
  17276. specifies a directory to be shared with write access, while the latter
  17277. provides read-only access to the shared directory.
  17278. The example below creates a VM in which the user's home directory is
  17279. accessible read-only, and where the @file{/exchange} directory is a
  17280. read-write mapping of @file{$HOME/tmp} on the host:
  17281. @example
  17282. guix system vm my-config.scm \
  17283. --expose=$HOME --share=$HOME/tmp=/exchange
  17284. @end example
  17285. On GNU/Linux, the default is to boot directly to the kernel; this has the
  17286. advantage of requiring only a very tiny root disk image since the store of
  17287. the host can then be mounted.
  17288. The @code{--full-boot} option forces a complete boot sequence, starting with
  17289. the bootloader. This requires more disk space since a root image containing
  17290. at least the kernel, initrd, and bootloader data files must be created. The
  17291. @code{--image-size} option can be used to specify the size of the image.
  17292. @cindex System images, creation in various formats
  17293. @cindex Creating system images in various formats
  17294. @item vm-image
  17295. @itemx disk-image
  17296. @itemx docker-image
  17297. Return a virtual machine, disk image, or Docker image of the operating
  17298. system declared in @var{file} that stands alone. By default, @command{guix
  17299. system} estimates the size of the image needed to store the system, but you
  17300. can use the @option{--image-size} option to specify a value. Docker images
  17301. are built to contain exactly what they need, so the @option{--image-size}
  17302. option is ignored in the case of @code{docker-image}.
  17303. You can specify the root file system type by using the
  17304. @option{--file-system-type} option. It defaults to @code{ext4}.
  17305. When using @code{vm-image}, the returned image is in qcow2 format, which the
  17306. QEMU emulator can efficiently use. @xref{GuixSD in einer VM starten}, for more
  17307. information on how to run the image in a virtual machine.
  17308. When using @code{disk-image}, a raw disk image is produced; it can be copied
  17309. as is to a USB stick, for instance. Assuming @code{/dev/sdc} is the device
  17310. corresponding to a USB stick, one can copy the image to it using the
  17311. following command:
  17312. @example
  17313. # dd if=$(guix system disk-image my-os.scm) of=/dev/sdc
  17314. @end example
  17315. When using @code{docker-image}, a Docker image is produced. Guix builds the
  17316. image from scratch, not from a pre-existing Docker base image. As a result,
  17317. it contains @emph{exactly} what you define in the operating system
  17318. configuration file. You can then load the image and launch a Docker
  17319. container using commands like the following:
  17320. @example
  17321. image_id="$(docker load < guixsd-docker-image.tar.gz)"
  17322. docker run -e GUIX_NEW_SYSTEM=/var/guix/profiles/system \\
  17323. --entrypoint /var/guix/profiles/system/profile/bin/guile \\
  17324. $image_id /var/guix/profiles/system/boot
  17325. @end example
  17326. This command starts a new Docker container from the specified image. It
  17327. will boot the GuixSD system in the usual manner, which means it will start
  17328. any services you have defined in the operating system configuration.
  17329. Depending on what you run in the Docker container, it may be necessary to
  17330. give the container additional permissions. For example, if you intend to
  17331. build software using Guix inside of the Docker container, you may need to
  17332. pass the @option{--privileged} option to @code{docker run}.
  17333. @item container
  17334. Return a script to run the operating system declared in @var{file} within a
  17335. container. Containers are a set of lightweight isolation mechanisms
  17336. provided by the kernel Linux-libre. Containers are substantially less
  17337. resource-demanding than full virtual machines since the kernel, shared
  17338. objects, and other resources can be shared with the host system; this also
  17339. means they provide thinner isolation.
  17340. Currently, the script must be run as root in order to support more than a
  17341. single user and group. The container shares its store with the host system.
  17342. As with the @code{vm} action (@pxref{guix system vm}), additional file
  17343. systems to be shared between the host and container can be specified using
  17344. the @option{--share} and @option{--expose} options:
  17345. @example
  17346. guix system container my-config.scm \
  17347. --expose=$HOME --share=$HOME/tmp=/exchange
  17348. @end example
  17349. @quotation Anmerkung
  17350. This option requires Linux-libre 3.19 or newer.
  17351. @end quotation
  17352. @end table
  17353. @var{options} can contain any of the common build options (@pxref{Gemeinsame Erstellungsoptionen}). In addition, @var{options} can contain one of the
  17354. following:
  17355. @table @option
  17356. @item --expression=@var{expr}
  17357. @itemx -e @var{expr}
  17358. Consider the operating-system @var{expr} evaluates to. This is an
  17359. alternative to specifying a file which evaluates to an operating system.
  17360. This is used to generate the GuixSD installer @pxref{Ein Abbild zur Installation erstellen}).
  17361. @item --system=@var{System}
  17362. @itemx -s @var{system}
  17363. Attempt to build for @var{system} instead of the host system type. This
  17364. works as per @command{guix build} (@pxref{Aufruf von guix build}).
  17365. @item --derivation
  17366. @itemx -d
  17367. Return the derivation file name of the given operating system without
  17368. building anything.
  17369. @item --file-system-type=@var{type}
  17370. @itemx -t @var{type}
  17371. For the @code{disk-image} action, create a file system of the given
  17372. @var{type} on the image.
  17373. When this option is omitted, @command{guix system} uses @code{ext4}.
  17374. @cindex ISO-9660 format
  17375. @cindex CD image format
  17376. @cindex DVD image format
  17377. @code{--file-system-type=iso9660} produces an ISO-9660 image, suitable for
  17378. burning on CDs and DVDs.
  17379. @item --image-size=@var{size}
  17380. For the @code{vm-image} and @code{disk-image} actions, create an image of
  17381. the given @var{size}. @var{size} may be a number of bytes, or it may
  17382. include a unit as a suffix (@pxref{Block size, size specifications,,
  17383. coreutils, GNU Coreutils}).
  17384. When this option is omitted, @command{guix system} computes an estimate of
  17385. the image size as a function of the size of the system declared in
  17386. @var{file}.
  17387. @item --root=@var{file}
  17388. @itemx -r @var{file}
  17389. Make @var{file} a symlink to the result, and register it as a garbage
  17390. collector root.
  17391. @item --skip-checks
  17392. Skip pre-installation safety checks.
  17393. By default, @command{guix system init} and @command{guix system reconfigure}
  17394. perform safety checks: they make sure the file systems that appear in the
  17395. @code{operating-system} declaration actually exist (@pxref{Dateisysteme}),
  17396. and that any Linux kernel modules that may be needed at boot time are listed
  17397. in @code{initrd-modules} (@pxref{Initiale RAM-Disk}). Passing this option
  17398. skips these tests altogether.
  17399. @item --on-error=@var{strategy}
  17400. Apply @var{strategy} when an error occurs when reading @var{file}.
  17401. @var{strategy} may be one of the following:
  17402. @table @code
  17403. @item nothing-special
  17404. Report the error concisely and exit. This is the default strategy.
  17405. @item backtrace
  17406. Likewise, but also display a backtrace.
  17407. @item debug
  17408. Report the error and enter Guile's debugger. From there, you can run
  17409. commands such as @code{,bt} to get a backtrace, @code{,locals} to display
  17410. local variable values, and more generally inspect the state of the program.
  17411. @xref{Debug Commands,,, guile, GNU Guile Reference Manual}, for a list of
  17412. available debugging commands.
  17413. @end table
  17414. @end table
  17415. @quotation Anmerkung
  17416. All the actions above, except @code{build} and @code{init}, can use KVM
  17417. support in the Linux-libre kernel. Specifically, if the machine has
  17418. hardware virtualization support, the corresponding KVM kernel module should
  17419. be loaded, and the @file{/dev/kvm} device node must exist and be readable
  17420. and writable by the user and by the build users of the daemon (@pxref{Einrichten der Erstellungsumgebung}).
  17421. @end quotation
  17422. Once you have built, configured, re-configured, and re-re-configured your
  17423. GuixSD installation, you may find it useful to list the operating system
  17424. generations available on disk---and that you can choose from the bootloader
  17425. boot menu:
  17426. @table @code
  17427. @item list-generations
  17428. List a summary of each generation of the operating system available on disk,
  17429. in a human-readable way. This is similar to the @option{--list-generations}
  17430. option of @command{guix package} (@pxref{Aufruf von guix package}).
  17431. Optionally, one can specify a pattern, with the same syntax that is used in
  17432. @command{guix package --list-generations}, to restrict the list of
  17433. generations displayed. For instance, the following command displays
  17434. generations that are up to 10 days old:
  17435. @example
  17436. $ guix system list-generations 10d
  17437. @end example
  17438. @end table
  17439. The @command{guix system} command has even more to offer! The following
  17440. sub-commands allow you to visualize how your system services relate to each
  17441. other:
  17442. @anchor{system-extension-graph}
  17443. @table @code
  17444. @item extension-graph
  17445. Emit in Dot/Graphviz format to standard output the @dfn{service extension
  17446. graph} of the operating system defined in @var{file} (@pxref{Dienstkompositionen}, for more information on service extensions.)
  17447. The command:
  17448. @example
  17449. $ guix system extension-graph @var{file} | dot -Tpdf > services.pdf
  17450. @end example
  17451. produces a PDF file showing the extension relations among services.
  17452. @anchor{system-shepherd-graph}
  17453. @item shepherd-graph
  17454. Emit in Dot/Graphviz format to standard output the @dfn{dependency graph} of
  17455. shepherd services of the operating system defined in @var{file}.
  17456. @xref{Shepherd-Dienste}, for more information and for an example graph.
  17457. @end table
  17458. @node GuixSD in einer VM starten
  17459. @subsection Running GuixSD in a Virtual Machine
  17460. @cindex virtual machine
  17461. To run GuixSD in a virtual machine (VM), one can either use the pre-built
  17462. GuixSD VM image distributed at
  17463. @indicateurl{https://alpha.gnu.org/gnu/guix/guixsd-vm-image-@value{VERSION}.@var{system}.xz}
  17464. , or build their own virtual machine image using @command{guix system
  17465. vm-image} (@pxref{Aufruf von guix system}). The returned image is in qcow2
  17466. format, which the @uref{http://qemu.org/, QEMU emulator} can efficiently
  17467. use.
  17468. @cindex QEMU
  17469. If you built your own image, you must copy it out of the store (@pxref{Der Store}) and give yourself permission to write to the copy before you can use
  17470. it. When invoking QEMU, you must choose a system emulator that is suitable
  17471. for your hardware platform. Here is a minimal QEMU invocation that will
  17472. boot the result of @command{guix system vm-image} on x86_64 hardware:
  17473. @example
  17474. $ qemu-system-x86_64 \
  17475. -net user -net nic,model=virtio \
  17476. -enable-kvm -m 256 /tmp/qemu-image
  17477. @end example
  17478. Here is what each of these options means:
  17479. @table @code
  17480. @item qemu-system-x86_64
  17481. This specifies the hardware platform to emulate. This should match the
  17482. host.
  17483. @item -net user
  17484. Enable the unprivileged user-mode network stack. The guest OS can access
  17485. the host but not vice versa. This is the simplest way to get the guest OS
  17486. online.
  17487. @item -net nic,model=virtio
  17488. You must create a network interface of a given model. If you do not create
  17489. a NIC, the boot will fail. Assuming your hardware platform is x86_64, you
  17490. can get a list of available NIC models by running
  17491. @command{qemu-system-x86_64 -net nic,model=help}.
  17492. @item -enable-kvm
  17493. If your system has hardware virtualization extensions, enabling the virtual
  17494. machine support (KVM) of the Linux kernel will make things run faster.
  17495. @item -m 256
  17496. RAM available to the guest OS, in mebibytes. Defaults to 128@tie{}MiB,
  17497. which may be insufficient for some operations.
  17498. @item /tmp/qemu-image
  17499. The file name of the qcow2 image.
  17500. @end table
  17501. The default @command{run-vm.sh} script that is returned by an invocation of
  17502. @command{guix system vm} does not add a @command{-net user} flag by
  17503. default. To get network access from within the vm add the
  17504. @code{(dhcp-client-service)} to your system definition and start the VM
  17505. using @command{`guix system vm config.scm` -net user}. An important caveat
  17506. of using @command{-net user} for networking is that @command{ping} will not
  17507. work, because it uses the ICMP protocol. You'll have to use a different
  17508. command to check for network connectivity, for example @command{guix
  17509. download}.
  17510. @subsubsection Connecting Through SSH
  17511. @cindex SSH
  17512. @cindex SSH server
  17513. To enable SSH inside a VM you need to add a SSH server like
  17514. @code{(dropbear-service)} or @code{(lsh-service)} to your VM. The
  17515. @code{(lsh-service}) doesn't currently boot unsupervised. It requires you
  17516. to type some characters to initialize the randomness generator. In addition
  17517. you need to forward the SSH port, 22 by default, to the host. You can do
  17518. this with
  17519. @example
  17520. `guix system vm config.scm` -net user,hostfwd=tcp::10022-:22
  17521. @end example
  17522. To connect to the VM you can run
  17523. @example
  17524. ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 10022
  17525. @end example
  17526. The @command{-p} tells @command{ssh} the port you want to connect to.
  17527. @command{-o UserKnownHostsFile=/dev/null} prevents @command{ssh} from
  17528. complaining every time you modify your @command{config.scm} file and the
  17529. @command{-o StrictHostKeyChecking=no} prevents you from having to allow a
  17530. connection to an unknown host every time you connect.
  17531. @subsubsection Using @command{virt-viewer} with Spice
  17532. As an alternative to the default @command{qemu} graphical client you can use
  17533. the @command{remote-viewer} from the @command{virt-viewer} package. To
  17534. connect pass the @command{-spice port=5930,disable-ticketing} flag to
  17535. @command{qemu}. See previous section for further information on how to do
  17536. this.
  17537. Spice also allows you to do some nice stuff like share your clipboard with
  17538. your VM. To enable that you'll also have to pass the following flags to
  17539. @command{qemu}:
  17540. @example
  17541. -device virtio-serial-pci,id=virtio-serial0,max_ports=16,bus=pci.0,addr=0x5
  17542. -chardev spicevmc,name=vdagent,id=vdagent
  17543. -device virtserialport,nr=1,bus=virtio-serial0.0,chardev=vdagent,
  17544. name=com.redhat.spice.0
  17545. @end example
  17546. You'll also need to add the @pxref{Verschiedene Dienste, Spice service}.
  17547. @node Dienste definieren
  17548. @subsection Dienste definieren
  17549. The previous sections show the available services and how one can combine
  17550. them in an @code{operating-system} declaration. But how do we define them
  17551. in the first place? And what is a service anyway?
  17552. @menu
  17553. * Dienstkompositionen:: Wie Dienste zusammengestellt werden.
  17554. * Diensttypen und Dienste:: Typen und Dienste.
  17555. * Service-Referenz:: Referenz zur Programmierschnittstelle.
  17556. * Shepherd-Dienste:: Eine spezielle Art von Dienst.
  17557. @end menu
  17558. @node Dienstkompositionen
  17559. @subsubsection Dienstkompositionen
  17560. @cindex services
  17561. @cindex daemons
  17562. Here we define a @dfn{service} as, broadly, something that extends the
  17563. functionality of the operating system. Often a service is a process---a
  17564. @dfn{daemon}---started when the system boots: a secure shell server, a Web
  17565. server, the Guix build daemon, etc. Sometimes a service is a daemon whose
  17566. execution can be triggered by another daemon---e.g., an FTP server started
  17567. by @command{inetd} or a D-Bus service activated by @command{dbus-daemon}.
  17568. Occasionally, a service does not map to a daemon. For instance, the
  17569. ``account'' service collects user accounts and makes sure they exist when
  17570. the system runs; the ``udev'' service collects device management rules and
  17571. makes them available to the eudev daemon; the @file{/etc} service populates
  17572. the @file{/etc} directory of the system.
  17573. @cindex service extensions
  17574. GuixSD services are connected by @dfn{extensions}. For instance, the secure
  17575. shell service @emph{extends} the Shepherd---the GuixSD initialization
  17576. system, running as PID@tie{}1---by giving it the command lines to start and
  17577. stop the secure shell daemon (@pxref{Netzwerkdienste,
  17578. @code{lsh-service}}); the UPower service extends the D-Bus service by
  17579. passing it its @file{.service} specification, and extends the udev service
  17580. by passing it device management rules (@pxref{Desktop-Dienste,
  17581. @code{upower-service}}); the Guix daemon service extends the Shepherd by
  17582. passing it the command lines to start and stop the daemon, and extends the
  17583. account service by passing it a list of required build user accounts
  17584. (@pxref{Basisdienste}).
  17585. All in all, services and their ``extends'' relations form a directed acyclic
  17586. graph (DAG). If we represent services as boxes and extensions as arrows, a
  17587. typical system might provide something like this:
  17588. @image{images/service-graph,,5in,Typical service extension graph.}
  17589. @cindex system service
  17590. At the bottom, we see the @dfn{system service}, which produces the directory
  17591. containing everything to run and boot the system, as returned by the
  17592. @command{guix system build} command. @xref{Service-Referenz}, to learn
  17593. about the other service types shown here. @xref{system-extension-graph, the
  17594. @command{guix system extension-graph} command}, for information on how to
  17595. generate this representation for a particular operating system definition.
  17596. @cindex service types
  17597. Technically, developers can define @dfn{service types} to express these
  17598. relations. There can be any number of services of a given type on the
  17599. system---for instance, a system running two instances of the GNU secure
  17600. shell server (lsh) has two instances of @var{lsh-service-type}, with
  17601. different parameters.
  17602. The following section describes the programming interface for service types
  17603. and services.
  17604. @node Diensttypen und Dienste
  17605. @subsubsection Diensttypen und Dienste
  17606. A @dfn{service type} is a node in the DAG described above. Let us start
  17607. with a simple example, the service type for the Guix build daemon
  17608. (@pxref{Aufruf des guix-daemon}):
  17609. @example
  17610. (define guix-service-type
  17611. (service-type
  17612. (name 'guix)
  17613. (extensions
  17614. (list (service-extension shepherd-root-service-type guix-shepherd-service)
  17615. (service-extension account-service-type guix-accounts)
  17616. (service-extension activation-service-type guix-activation)))
  17617. (default-value (guix-configuration))))
  17618. @end example
  17619. @noindent
  17620. It defines three things:
  17621. @enumerate
  17622. @item
  17623. A name, whose sole purpose is to make inspection and debugging easier.
  17624. @item
  17625. A list of @dfn{service extensions}, where each extension designates the
  17626. target service type and a procedure that, given the parameters of the
  17627. service, returns a list of objects to extend the service of that type.
  17628. Every service type has at least one service extension. The only exception
  17629. is the @dfn{boot service type}, which is the ultimate service.
  17630. @item
  17631. Optionally, a default value for instances of this type.
  17632. @end enumerate
  17633. In this example, @var{guix-service-type} extends three services:
  17634. @table @var
  17635. @item shepherd-root-service-type
  17636. The @var{guix-shepherd-service} procedure defines how the Shepherd service
  17637. is extended. Namely, it returns a @code{<shepherd-service>} object that
  17638. defines how @command{guix-daemon} is started and stopped (@pxref{Shepherd-Dienste}).
  17639. @item account-service-type
  17640. This extension for this service is computed by @var{guix-accounts}, which
  17641. returns a list of @code{user-group} and @code{user-account} objects
  17642. representing the build user accounts (@pxref{Aufruf des guix-daemon}).
  17643. @item activation-service-type
  17644. Here @var{guix-activation} is a procedure that returns a gexp, which is a
  17645. code snippet to run at ``activation time''---e.g., when the service is
  17646. booted.
  17647. @end table
  17648. A service of this type is instantiated like this:
  17649. @example
  17650. (service guix-service-type
  17651. (guix-configuration
  17652. (build-accounts 5)
  17653. (use-substitutes? #f)))
  17654. @end example
  17655. The second argument to the @code{service} form is a value representing the
  17656. parameters of this specific service instance.
  17657. @xref{guix-configuration-type, @code{guix-configuration}}, for information
  17658. about the @code{guix-configuration} data type. When the value is omitted,
  17659. the default value specified by @code{guix-service-type} is used:
  17660. @example
  17661. (service guix-service-type)
  17662. @end example
  17663. @var{guix-service-type} is quite simple because it extends other services
  17664. but is not extensible itself.
  17665. @c @subsubsubsection Extensible Service Types
  17666. The service type for an @emph{extensible} service looks like this:
  17667. @example
  17668. (define udev-service-type
  17669. (service-type (name 'udev)
  17670. (extensions
  17671. (list (service-extension shepherd-root-service-type
  17672. udev-shepherd-service)))
  17673. (compose concatenate) ;concatenate the list of rules
  17674. (extend (lambda (config rules)
  17675. (match config
  17676. (($ <udev-configuration> udev initial-rules)
  17677. (udev-configuration
  17678. (udev udev) ;the udev package to use
  17679. (rules (append initial-rules rules)))))))))
  17680. @end example
  17681. This is the service type for the
  17682. @uref{https://wiki.gentoo.org/wiki/Project:Eudev, eudev device management
  17683. daemon}. Compared to the previous example, in addition to an extension of
  17684. @var{shepherd-root-service-type}, we see two new fields:
  17685. @table @code
  17686. @item compose
  17687. This is the procedure to @dfn{compose} the list of extensions to services of
  17688. this type.
  17689. Services can extend the udev service by passing it lists of rules; we
  17690. compose those extensions simply by concatenating them.
  17691. @item extend
  17692. This procedure defines how the value of the service is @dfn{extended} with
  17693. the composition of the extensions.
  17694. Udev extensions are composed into a list of rules, but the udev service
  17695. value is itself a @code{<udev-configuration>} record. So here, we extend
  17696. that record by appending the list of rules it contains to the list of
  17697. contributed rules.
  17698. @item description
  17699. This is a string giving an overview of the service type. The string can
  17700. contain Texinfo markup (@pxref{Overview,,, texinfo, GNU Texinfo}). The
  17701. @command{guix system search} command searches these strings and displays
  17702. them (@pxref{Aufruf von guix system}).
  17703. @end table
  17704. There can be only one instance of an extensible service type such as
  17705. @var{udev-service-type}. If there were more, the @code{service-extension}
  17706. specifications would be ambiguous.
  17707. Still here? The next section provides a reference of the programming
  17708. interface for services.
  17709. @node Service-Referenz
  17710. @subsubsection Service-Referenz
  17711. We have seen an overview of service types (@pxref{Diensttypen und Dienste}). This section provides a reference on how to manipulate services
  17712. and service types. This interface is provided by the @code{(gnu services)}
  17713. module.
  17714. @deffn {Scheme Procedure} service @var{type} [@var{value}]
  17715. Return a new service of @var{type}, a @code{<service-type>} object (see
  17716. below.) @var{value} can be any object; it represents the parameters of this
  17717. particular service instance.
  17718. When @var{value} is omitted, the default value specified by @var{type} is
  17719. used; if @var{type} does not specify a default value, an error is raised.
  17720. For instance, this:
  17721. @example
  17722. (service openssh-service-type)
  17723. @end example
  17724. @noindent
  17725. is equivalent to this:
  17726. @example
  17727. (service openssh-service-type
  17728. (openssh-configuration))
  17729. @end example
  17730. In both cases the result is an instance of @code{openssh-service-type} with
  17731. the default configuration.
  17732. @end deffn
  17733. @deffn {Scheme Procedure} service? @var{obj}
  17734. Return true if @var{obj} is a service.
  17735. @end deffn
  17736. @deffn {Scheme Procedure} service-kind @var{service}
  17737. Return the type of @var{service}---i.e., a @code{<service-type>} object.
  17738. @end deffn
  17739. @deffn {Scheme Procedure} service-value @var{service}
  17740. Return the value associated with @var{service}. It represents its
  17741. parameters.
  17742. @end deffn
  17743. Here is an example of how a service is created and manipulated:
  17744. @example
  17745. (define s
  17746. (service nginx-service-type
  17747. (nginx-configuration
  17748. (nginx nginx)
  17749. (log-directory log-directory)
  17750. (run-directory run-directory)
  17751. (file config-file))))
  17752. (service? s)
  17753. @result{} #t
  17754. (eq? (service-kind s) nginx-service-type)
  17755. @result{} #t
  17756. @end example
  17757. The @code{modify-services} form provides a handy way to change the
  17758. parameters of some of the services of a list such as @var{%base-services}
  17759. (@pxref{Basisdienste, @code{%base-services}}). It evaluates to a list of
  17760. services. Of course, you could always use standard list combinators such as
  17761. @code{map} and @code{fold} to do that (@pxref{SRFI-1, List Library,, guile,
  17762. GNU Guile Reference Manual}); @code{modify-services} simply provides a more
  17763. concise form for this common pattern.
  17764. @deffn {Scheme Syntax} modify-services @var{services} @
  17765. (@var{type} @var{variable} => @var{body}) @dots{}
  17766. Modify the services listed in @var{services} according to the given
  17767. clauses. Each clause has the form:
  17768. @example
  17769. (@var{type} @var{variable} => @var{body})
  17770. @end example
  17771. where @var{type} is a service type---e.g., @code{guix-service-type}---and
  17772. @var{variable} is an identifier that is bound within the @var{body} to the
  17773. service parameters---e.g., a @code{guix-configuration} instance---of the
  17774. original service of that @var{type}.
  17775. The @var{body} should evaluate to the new service parameters, which will be
  17776. used to configure the new service. This new service will replace the
  17777. original in the resulting list. Because a service's service parameters are
  17778. created using @code{define-record-type*}, you can write a succinct
  17779. @var{body} that evaluates to the new service parameters by using the
  17780. @code{inherit} feature that @code{define-record-type*} provides.
  17781. @xref{Das Konfigurationssystem nutzen}, for example usage.
  17782. @end deffn
  17783. Next comes the programming interface for service types. This is something
  17784. you want to know when writing new service definitions, but not necessarily
  17785. when simply looking for ways to customize your @code{operating-system}
  17786. declaration.
  17787. @deftp {Data Type} service-type
  17788. @cindex service type
  17789. This is the representation of a @dfn{service type} (@pxref{Diensttypen und Dienste}).
  17790. @table @asis
  17791. @item @code{name}
  17792. This is a symbol, used only to simplify inspection and debugging.
  17793. @item @code{extensions}
  17794. A non-empty list of @code{<service-extension>} objects (see below).
  17795. @item @code{compose} (default: @code{#f})
  17796. If this is @code{#f}, then the service type denotes services that cannot be
  17797. extended---i.e., services that do not receive ``values'' from other
  17798. services.
  17799. Otherwise, it must be a one-argument procedure. The procedure is called by
  17800. @code{fold-services} and is passed a list of values collected from
  17801. extensions. It may return any single value.
  17802. @item @code{extend} (default: @code{#f})
  17803. If this is @code{#f}, services of this type cannot be extended.
  17804. Otherwise, it must be a two-argument procedure: @code{fold-services} calls
  17805. it, passing it the initial value of the service as the first argument and
  17806. the result of applying @code{compose} to the extension values as the second
  17807. argument. It must return a value that is a valid parameter value for the
  17808. service instance.
  17809. @end table
  17810. @xref{Diensttypen und Dienste}, for examples.
  17811. @end deftp
  17812. @deffn {Scheme Procedure} service-extension @var{target-type} @
  17813. @var{compute} Return a new extension for services of type
  17814. @var{target-type}. @var{compute} must be a one-argument procedure:
  17815. @code{fold-services} calls it, passing it the value associated with the
  17816. service that provides the extension; it must return a valid value for the
  17817. target service.
  17818. @end deffn
  17819. @deffn {Scheme Procedure} service-extension? @var{obj}
  17820. Return true if @var{obj} is a service extension.
  17821. @end deffn
  17822. Occasionally, you might want to simply extend an existing service. This
  17823. involves creating a new service type and specifying the extension of
  17824. interest, which can be verbose; the @code{simple-service} procedure provides
  17825. a shorthand for this.
  17826. @deffn {Scheme Procedure} simple-service @var{name} @var{target} @var{value}
  17827. Return a service that extends @var{target} with @var{value}. This works by
  17828. creating a singleton service type @var{name}, of which the returned service
  17829. is an instance.
  17830. For example, this extends mcron (@pxref{Geplante Auftragsausführung}) with an
  17831. additional job:
  17832. @example
  17833. (simple-service 'my-mcron-job mcron-service-type
  17834. #~(job '(next-hour (3)) "guix gc -F 2G"))
  17835. @end example
  17836. @end deffn
  17837. At the core of the service abstraction lies the @code{fold-services}
  17838. procedure, which is responsible for ``compiling'' a list of services down to
  17839. a single directory that contains everything needed to boot and run the
  17840. system---the directory shown by the @command{guix system build} command
  17841. (@pxref{Aufruf von guix system}). In essence, it propagates service
  17842. extensions down the service graph, updating each node parameters on the way,
  17843. until it reaches the root node.
  17844. @deffn {Scheme Procedure} fold-services @var{services} @
  17845. [#:target-type @var{system-service-type}] Fold @var{services} by propagating
  17846. their extensions down to the root of type @var{target-type}; return the root
  17847. service adjusted accordingly.
  17848. @end deffn
  17849. Lastly, the @code{(gnu services)} module also defines several essential
  17850. service types, some of which are listed below.
  17851. @defvr {Scheme Variable} system-service-type
  17852. This is the root of the service graph. It produces the system directory as
  17853. returned by the @command{guix system build} command.
  17854. @end defvr
  17855. @defvr {Scheme Variable} boot-service-type
  17856. The type of the ``boot service'', which produces the @dfn{boot script}. The
  17857. boot script is what the initial RAM disk runs when booting.
  17858. @end defvr
  17859. @defvr {Scheme Variable} etc-service-type
  17860. The type of the @file{/etc} service. This service is used to create files
  17861. under @file{/etc} and can be extended by passing it name/file tuples such
  17862. as:
  17863. @example
  17864. (list `("issue" ,(plain-file "issue" "Welcome!\n")))
  17865. @end example
  17866. In this example, the effect would be to add an @file{/etc/issue} file
  17867. pointing to the given file.
  17868. @end defvr
  17869. @defvr {Scheme Variable} setuid-program-service-type
  17870. Type for the ``setuid-program service''. This service collects lists of
  17871. executable file names, passed as gexps, and adds them to the set of
  17872. setuid-root programs on the system (@pxref{Setuid-Programme}).
  17873. @end defvr
  17874. @defvr {Scheme Variable} profile-service-type
  17875. Type of the service that populates the @dfn{system profile}---i.e., the
  17876. programs under @file{/run/current-system/profile}. Other services can
  17877. extend it by passing it lists of packages to add to the system profile.
  17878. @end defvr
  17879. @node Shepherd-Dienste
  17880. @subsubsection Shepherd-Dienste
  17881. @cindex shepherd services
  17882. @cindex PID 1
  17883. @cindex init system
  17884. The @code{(gnu services shepherd)} module provides a way to define services
  17885. managed by the GNU@tie{}Shepherd, which is the GuixSD initialization
  17886. system---the first process that is started when the system boots, also known
  17887. as PID@tie{}1 (@pxref{Einführung,,, shepherd, The GNU Shepherd Manual}).
  17888. Services in the Shepherd can depend on each other. For instance, the SSH
  17889. daemon may need to be started after the syslog daemon has been started,
  17890. which in turn can only happen once all the file systems have been mounted.
  17891. The simple operating system defined earlier (@pxref{Das Konfigurationssystem nutzen}) results in a service graph like this:
  17892. @image{images/shepherd-graph,,5in,Typical shepherd service graph.}
  17893. You can actually generate such a graph for any operating system definition
  17894. using the @command{guix system shepherd-graph} command
  17895. (@pxref{system-shepherd-graph, @command{guix system shepherd-graph}}).
  17896. The @var{%shepherd-root-service} is a service object representing
  17897. PID@tie{}1, of type @var{shepherd-root-service-type}; it can be extended by
  17898. passing it lists of @code{<shepherd-service>} objects.
  17899. @deftp {Data Type} shepherd-service
  17900. The data type representing a service managed by the Shepherd.
  17901. @table @asis
  17902. @item @code{provision}
  17903. This is a list of symbols denoting what the service provides.
  17904. These are the names that may be passed to @command{herd start},
  17905. @command{herd status}, and similar commands (@pxref{Invoking herd,,,
  17906. shepherd, The GNU Shepherd Manual}). @xref{Slots of services, the
  17907. @code{provides} slot,, shepherd, The GNU Shepherd Manual}, for details.
  17908. @item @code{requirements} (default: @code{'()})
  17909. List of symbols denoting the Shepherd services this one depends on.
  17910. @item @code{respawn?} (default: @code{#t})
  17911. Whether to restart the service when it stops, for instance when the
  17912. underlying process dies.
  17913. @item @code{start}
  17914. @itemx @code{stop} (default: @code{#~(const #f)})
  17915. The @code{start} and @code{stop} fields refer to the Shepherd's facilities
  17916. to start and stop processes (@pxref{Service De- and Constructors,,,
  17917. shepherd, The GNU Shepherd Manual}). They are given as G-expressions that
  17918. get expanded in the Shepherd configuration file (@pxref{G-Ausdrücke}).
  17919. @item @code{actions} (default: @code{'()})
  17920. @cindex actions, of Shepherd services
  17921. This is a list of @code{shepherd-action} objects (see below) defining
  17922. @dfn{actions} supported by the service, in addition to the standard
  17923. @code{start} and @code{stop} actions. Actions listed here become available
  17924. as @command{herd} sub-commands:
  17925. @example
  17926. herd @var{action} @var{service} [@var{arguments}@dots{}]
  17927. @end example
  17928. @item @code{Dokumentation}
  17929. A documentation string, as shown when running:
  17930. @example
  17931. herd doc @var{service-name}
  17932. @end example
  17933. where @var{service-name} is one of the symbols in @var{provision}
  17934. (@pxref{Invoking herd,,, shepherd, The GNU Shepherd Manual}).
  17935. @item @code{modules} (default: @var{%default-modules})
  17936. This is the list of modules that must be in scope when @code{start} and
  17937. @code{stop} are evaluated.
  17938. @end table
  17939. @end deftp
  17940. @deftp {Data Type} shepherd-action
  17941. This is the data type that defines additional actions implemented by a
  17942. Shepherd service (see above).
  17943. @table @code
  17944. @item name
  17945. Symbol naming the action.
  17946. @item Dokumentation
  17947. This is a documentation string for the action. It can be viewed by running:
  17948. @example
  17949. herd doc @var{service} action @var{action}
  17950. @end example
  17951. @item procedure
  17952. This should be a gexp that evaluates to a procedure of at least one
  17953. argument, which is the ``running value'' of the service (@pxref{Slots of
  17954. services,,, shepherd, The GNU Shepherd Manual}).
  17955. @end table
  17956. The following example defines an action called @code{say-hello} that kindly
  17957. greets the user:
  17958. @example
  17959. (shepherd-action
  17960. (name 'say-hello)
  17961. (documentation "Say hi!")
  17962. (procedure #~(lambda (running . args)
  17963. (format #t "Hello, friend! arguments: ~s\n"
  17964. args)
  17965. #t)))
  17966. @end example
  17967. Assuming this action is added to the @code{example} service, then you can
  17968. do:
  17969. @example
  17970. # herd say-hello example
  17971. Hello, friend! arguments: ()
  17972. # herd say-hello example a b c
  17973. Hello, friend! arguments: ("a" "b" "c")
  17974. @end example
  17975. This, as you can see, is a fairly sophisticated way to say hello.
  17976. @xref{Service Convenience,,, shepherd, The GNU Shepherd Manual}, for more
  17977. info on actions.
  17978. @end deftp
  17979. @defvr {Scheme Variable} shepherd-root-service-type
  17980. The service type for the Shepherd ``root service''---i.e., PID@tie{}1.
  17981. This is the service type that extensions target when they want to create
  17982. shepherd services (@pxref{Diensttypen und Dienste}, for an example).
  17983. Each extension must pass a list of @code{<shepherd-service>}.
  17984. @end defvr
  17985. @defvr {Scheme Variable} %shepherd-root-service
  17986. This service represents PID@tie{}1.
  17987. @end defvr
  17988. @node Dokumentation
  17989. @section Dokumentation
  17990. @cindex documentation, searching for
  17991. @cindex searching for documentation
  17992. @cindex Info, documentation format
  17993. @cindex man pages
  17994. @cindex manual pages
  17995. In most cases packages installed with Guix come with documentation. There
  17996. are two main documentation formats: ``Info'', a browseable hypertext format
  17997. used for GNU software, and ``manual pages'' (or ``man pages''), the linear
  17998. documentation format traditionally found on Unix. Info manuals are accessed
  17999. with the @command{info} command or with Emacs, and man pages are accessed
  18000. using @command{man}.
  18001. You can look for documentation of software installed on your system by
  18002. keyword. For example, the following command searches for information about
  18003. ``TLS'' in Info manuals:
  18004. @example
  18005. $ info -k TLS
  18006. "(emacs)Network Security" -- STARTTLS
  18007. "(emacs)Network Security" -- TLS
  18008. "(gnutls)Core TLS API" -- gnutls_certificate_set_verify_flags
  18009. "(gnutls)Core TLS API" -- gnutls_certificate_set_verify_function
  18010. @dots{}
  18011. @end example
  18012. @noindent
  18013. The command below searches for the same keyword in man pages:
  18014. @example
  18015. $ man -k TLS
  18016. SSL (7) - OpenSSL SSL/TLS library
  18017. certtool (1) - GnuTLS certificate tool
  18018. @dots {}
  18019. @end example
  18020. These searches are purely local to your computer so you have the guarantee
  18021. that documentation you find corresponds to what you have actually installed,
  18022. you can access it off-line, and your privacy is respected.
  18023. Once you have these results, you can view the relevant documentation by
  18024. running, say:
  18025. @example
  18026. $ info "(gnutls)Core TLS API"
  18027. @end example
  18028. @noindent
  18029. or:
  18030. @example
  18031. $ man certtool
  18032. @end example
  18033. Info manuals contain sections and indices as well as hyperlinks like those
  18034. found in Web pages. The @command{info} reader (@pxref{Top, Info reader,,
  18035. info-stnd, Stand-alone GNU Info}) and its Emacs counterpart (@pxref{Misc
  18036. Help,,, emacs, The GNU Emacs Manual}) provide intuitive key bindings to
  18037. navigate manuals. @xref{Getting Started,,, info, Info: An Introduction},
  18038. for an introduction to Info navigation.
  18039. @node Dateien zur Fehlersuche installieren
  18040. @section Dateien zur Fehlersuche installieren
  18041. @cindex debugging files
  18042. Program binaries, as produced by the GCC compilers for instance, are
  18043. typically written in the ELF format, with a section containing
  18044. @dfn{debugging information}. Debugging information is what allows the
  18045. debugger, GDB, to map binary code to source code; it is required to debug a
  18046. compiled program in good conditions.
  18047. The problem with debugging information is that is takes up a fair amount of
  18048. disk space. For example, debugging information for the GNU C Library weighs
  18049. in at more than 60 MiB. Thus, as a user, keeping all the debugging info of
  18050. all the installed programs is usually not an option. Yet, space savings
  18051. should not come at the cost of an impediment to debugging---especially in
  18052. the GNU system, which should make it easier for users to exert their
  18053. computing freedom (@pxref{GNU-Distribution}).
  18054. Thankfully, the GNU Binary Utilities (Binutils) and GDB provide a mechanism
  18055. that allows users to get the best of both worlds: debugging information can
  18056. be stripped from the binaries and stored in separate files. GDB is then
  18057. able to load debugging information from those files, when they are available
  18058. (@pxref{Separate Debug Files,,, gdb, Debugging with GDB}).
  18059. The GNU distribution takes advantage of this by storing debugging
  18060. information in the @code{lib/debug} sub-directory of a separate package
  18061. output unimaginatively called @code{debug} (@pxref{Pakete mit mehreren Ausgaben.}). Users can choose to install the @code{debug} output of a package
  18062. when they need it. For instance, the following command installs the
  18063. debugging information for the GNU C Library and for GNU Guile:
  18064. @example
  18065. guix package -i glibc:debug guile:debug
  18066. @end example
  18067. GDB must then be told to look for debug files in the user's profile, by
  18068. setting the @code{debug-file-directory} variable (consider setting it from
  18069. the @file{~/.gdbinit} file, @pxref{Startup,,, gdb, Debugging with GDB}):
  18070. @example
  18071. (gdb) set debug-file-directory ~/.guix-profile/lib/debug
  18072. @end example
  18073. From there on, GDB will pick up debugging information from the @code{.debug}
  18074. files under @file{~/.guix-profile/lib/debug}.
  18075. In addition, you will most likely want GDB to be able to show the source
  18076. code being debugged. To do that, you will have to unpack the source code of
  18077. the package of interest (obtained with @code{guix build --source},
  18078. @pxref{Aufruf von guix build}), and to point GDB to that source directory
  18079. using the @code{directory} command (@pxref{Source Path, @code{directory},,
  18080. gdb, Debugging with GDB}).
  18081. @c XXX: keep me up-to-date
  18082. The @code{debug} output mechanism in Guix is implemented by the
  18083. @code{gnu-build-system} (@pxref{Erstellungssysteme}). Currently, it is
  18084. opt-in---debugging information is available only for the packages with
  18085. definitions explicitly declaring a @code{debug} output. This may be changed
  18086. to opt-out in the future if our build farm servers can handle the load. To
  18087. check whether a package has a @code{debug} output, use @command{guix package
  18088. --list-available} (@pxref{Aufruf von guix package}).
  18089. @node Sicherheitsaktualisierungen
  18090. @section Sicherheitsaktualisierungen
  18091. @cindex security updates
  18092. @cindex security vulnerabilities
  18093. Occasionally, important security vulnerabilities are discovered in software
  18094. packages and must be patched. Guix developers try hard to keep track of
  18095. known vulnerabilities and to apply fixes as soon as possible in the
  18096. @code{master} branch of Guix (we do not yet provide a ``stable'' branch
  18097. containing only security updates.) The @command{guix lint} tool helps
  18098. developers find out about vulnerable versions of software packages in the
  18099. distribution:
  18100. @smallexample
  18101. $ guix lint -c cve
  18102. gnu/packages/base.scm:652:2: glibc@@2.21: probably vulnerable to CVE-2015-1781, CVE-2015-7547
  18103. gnu/packages/gcc.scm:334:2: gcc@@4.9.3: probably vulnerable to CVE-2015-5276
  18104. gnu/packages/image.scm:312:2: openjpeg@@2.1.0: probably vulnerable to CVE-2016-1923, CVE-2016-1924
  18105. @dots{}
  18106. @end smallexample
  18107. @xref{Aufruf von guix lint}, for more information.
  18108. @quotation Anmerkung
  18109. As of version @value{VERSION}, the feature described below is considered
  18110. ``beta''.
  18111. @end quotation
  18112. Guix follows a functional package management discipline
  18113. (@pxref{Einführung}), which implies that, when a package is changed,
  18114. @emph{every package that depends on it} must be rebuilt. This can
  18115. significantly slow down the deployment of fixes in core packages such as
  18116. libc or Bash, since basically the whole distribution would need to be
  18117. rebuilt. Using pre-built binaries helps (@pxref{Substitute}), but
  18118. deployment may still take more time than desired.
  18119. @cindex grafts
  18120. To address this, Guix implements @dfn{grafts}, a mechanism that allows for
  18121. fast deployment of critical updates without the costs associated with a
  18122. whole-distribution rebuild. The idea is to rebuild only the package that
  18123. needs to be patched, and then to ``graft'' it onto packages explicitly
  18124. installed by the user and that were previously referring to the original
  18125. package. The cost of grafting is typically very low, and order of
  18126. magnitudes lower than a full rebuild of the dependency chain.
  18127. @cindex replacements of packages, for grafts
  18128. For instance, suppose a security update needs to be applied to Bash. Guix
  18129. developers will provide a package definition for the ``fixed'' Bash, say
  18130. @var{bash-fixed}, in the usual way (@pxref{Pakete definieren}). Then, the
  18131. original package definition is augmented with a @code{replacement} field
  18132. pointing to the package containing the bug fix:
  18133. @example
  18134. (define bash
  18135. (package
  18136. (name "bash")
  18137. ;; @dots{}
  18138. (replacement bash-fixed)))
  18139. @end example
  18140. From there on, any package depending directly or indirectly on Bash---as
  18141. reported by @command{guix gc --requisites} (@pxref{Aufruf von guix gc})---that
  18142. is installed is automatically ``rewritten'' to refer to @var{bash-fixed}
  18143. instead of @var{bash}. This grafting process takes time proportional to the
  18144. size of the package, usually less than a minute for an ``average'' package
  18145. on a recent machine. Grafting is recursive: when an indirect dependency
  18146. requires grafting, then grafting ``propagates'' up to the package that the
  18147. user is installing.
  18148. Currently, the length of the name and version of the graft and that of the
  18149. package it replaces (@var{bash-fixed} and @var{bash} in the example above)
  18150. must be equal. This restriction mostly comes from the fact that grafting
  18151. works by patching files, including binary files, directly. Other
  18152. restrictions may apply: for instance, when adding a graft to a package
  18153. providing a shared library, the original shared library and its replacement
  18154. must have the same @code{SONAME} and be binary-compatible.
  18155. The @option{--no-grafts} command-line option allows you to forcefully avoid
  18156. grafting (@pxref{Gemeinsame Erstellungsoptionen, @option{--no-grafts}}). Thus, the
  18157. command:
  18158. @example
  18159. guix build bash --no-grafts
  18160. @end example
  18161. @noindent
  18162. returns the store file name of the original Bash, whereas:
  18163. @example
  18164. guix build bash
  18165. @end example
  18166. @noindent
  18167. returns the store file name of the ``fixed'', replacement Bash. This allows
  18168. you to distinguish between the two variants of Bash.
  18169. To verify which Bash your whole profile refers to, you can run
  18170. (@pxref{Aufruf von guix gc}):
  18171. @example
  18172. guix gc -R `readlink -f ~/.guix-profile` | grep bash
  18173. @end example
  18174. @noindent
  18175. @dots{} and compare the store file names that you get with those above.
  18176. Likewise for a complete GuixSD system generation:
  18177. @example
  18178. guix gc -R `guix system build my-config.scm` | grep bash
  18179. @end example
  18180. Lastly, to check which Bash running processes are using, you can use the
  18181. @command{lsof} command:
  18182. @example
  18183. lsof | grep /gnu/store/.*bash
  18184. @end example
  18185. @node Paketmodule
  18186. @section Paketmodule
  18187. From a programming viewpoint, the package definitions of the GNU
  18188. distribution are provided by Guile modules in the @code{(gnu packages
  18189. @dots{})} name space@footnote{Note that packages under the @code{(gnu
  18190. packages @dots{})} module name space are not necessarily ``GNU packages''.
  18191. This module naming scheme follows the usual Guile module naming convention:
  18192. @code{gnu} means that these modules are distributed as part of the GNU
  18193. system, and @code{packages} identifies modules that define packages.}
  18194. (@pxref{Module, Guile modules,, guile, GNU Guile Reference Manual}). For
  18195. instance, the @code{(gnu packages emacs)} module exports a variable named
  18196. @code{emacs}, which is bound to a @code{<package>} object (@pxref{Pakete definieren}).
  18197. The @code{(gnu packages @dots{})} module name space is automatically scanned
  18198. for packages by the command-line tools. For instance, when running
  18199. @code{guix package -i emacs}, all the @code{(gnu packages @dots{})} modules
  18200. are scanned until one that exports a package object whose name is
  18201. @code{emacs} is found. This package search facility is implemented in the
  18202. @code{(gnu packages)} module.
  18203. @cindex Anpassung, von Paketen
  18204. @cindex package module search path
  18205. Users can store package definitions in modules with different names---e.g.,
  18206. @code{(my-packages emacs)}@footnote{Note that the file name and module name
  18207. must match. For instance, the @code{(my-packages emacs)} module must be
  18208. stored in a @file{my-packages/emacs.scm} file relative to the load path
  18209. specified with @option{--load-path} or @code{GUIX_PACKAGE_PATH}.
  18210. @xref{Modules and the File System,,, guile, GNU Guile Reference Manual}, for
  18211. details.}. There are two ways to make these package definitions visible to
  18212. the user interfaces:
  18213. @enumerate
  18214. @item
  18215. By adding the directory containing your package modules to the search path
  18216. with the @code{-L} flag of @command{guix package} and other commands
  18217. (@pxref{Gemeinsame Erstellungsoptionen}), or by setting the @code{GUIX_PACKAGE_PATH}
  18218. environment variable described below.
  18219. @item
  18220. By defining a @dfn{channel} and configuring @command{guix pull} so that it
  18221. pulls from it. A channel is essentially a Git repository containing package
  18222. modules. @xref{Channels}, for more information on how to define and use
  18223. channels.
  18224. @end enumerate
  18225. @code{GUIX_PACKAGE_PATH} works similarly to other search path variables:
  18226. @defvr {Environment Variable} GUIX_PACKAGE_PATH
  18227. This is a colon-separated list of directories to search for additional
  18228. package modules. Directories listed in this variable take precedence over
  18229. the own modules of the distribution.
  18230. @end defvr
  18231. The distribution is fully @dfn{bootstrapped} and @dfn{self-contained}: each
  18232. package is built based solely on other packages in the distribution. The
  18233. root of this dependency graph is a small set of @dfn{bootstrap binaries},
  18234. provided by the @code{(gnu packages bootstrap)} module. For more
  18235. information on bootstrapping, @pxref{Bootstrapping}.
  18236. @node Paketrichtlinien
  18237. @section Paketrichtlinien
  18238. @cindex packages, creating
  18239. The GNU distribution is nascent and may well lack some of your favorite
  18240. packages. This section describes how you can help make the distribution
  18241. grow. @xref{Mitwirken}, for additional information on how you can help.
  18242. Free software packages are usually distributed in the form of @dfn{source
  18243. code tarballs}---typically @file{tar.gz} files that contain all the source
  18244. files. Adding a package to the distribution means essentially two things:
  18245. adding a @dfn{recipe} that describes how to build the package, including a
  18246. list of other packages required to build it, and adding @dfn{package
  18247. metadata} along with that recipe, such as a description and licensing
  18248. information.
  18249. In Guix all this information is embodied in @dfn{package definitions}.
  18250. Package definitions provide a high-level view of the package. They are
  18251. written using the syntax of the Scheme programming language; in fact, for
  18252. each package we define a variable bound to the package definition, and
  18253. export that variable from a module (@pxref{Paketmodule}). However,
  18254. in-depth Scheme knowledge is @emph{not} a prerequisite for creating
  18255. packages. For more information on package definitions, @pxref{Pakete definieren}.
  18256. Once a package definition is in place, stored in a file in the Guix source
  18257. tree, it can be tested using the @command{guix build} command
  18258. (@pxref{Aufruf von guix build}). For example, assuming the new package is
  18259. called @code{gnew}, you may run this command from the Guix build tree
  18260. (@pxref{Guix vor der Installation ausführen}):
  18261. @example
  18262. ./pre-inst-env guix build gnew --keep-failed
  18263. @end example
  18264. Using @code{--keep-failed} makes it easier to debug build failures since it
  18265. provides access to the failed build tree. Another useful command-line
  18266. option when debugging is @code{--log-file}, to access the build log.
  18267. If the package is unknown to the @command{guix} command, it may be that the
  18268. source file contains a syntax error, or lacks a @code{define-public} clause
  18269. to export the package variable. To figure it out, you may load the module
  18270. from Guile to get more information about the actual error:
  18271. @example
  18272. ./pre-inst-env guile -c '(use-modules (gnu packages gnew))'
  18273. @end example
  18274. Once your package builds correctly, please send us a patch
  18275. (@pxref{Mitwirken}). Well, if you need help, we will be happy to help
  18276. you too. Once the patch is committed in the Guix repository, the new
  18277. package automatically gets built on the supported platforms by
  18278. @url{http://hydra.gnu.org/jobset/gnu/master, our continuous integration
  18279. system}.
  18280. @cindex substituter
  18281. Users can obtain the new package definition simply by running @command{guix
  18282. pull} (@pxref{Aufruf von guix pull}). When @code{hydra.gnu.org} is done
  18283. building the package, installing the package automatically downloads
  18284. binaries from there (@pxref{Substitute}). The only place where human
  18285. intervention is needed is to review and apply the patch.
  18286. @menu
  18287. * Software-Freiheit:: Was in die Distribution aufgenommen werden
  18288. darf.
  18289. * Paketbenennung:: Was macht einen Namen aus?
  18290. * Versionsnummern:: Wenn der Name noch nicht genug ist.
  18291. * Zusammenfassungen und Beschreibungen:: Den Nutzern helfen, das richtige
  18292. Paket zu finden.
  18293. * Python-Module:: Ein Touch britischer Comedy.
  18294. * Perl-Module:: Kleine Perlen.
  18295. * Java-Pakete:: Kaffeepause.
  18296. * Schriftarten:: Schriften verschriftlicht.
  18297. @end menu
  18298. @node Software-Freiheit
  18299. @subsection Software-Freiheit
  18300. @c Adapted from http://www.gnu.org/philosophy/philosophy.html.
  18301. @cindex free software
  18302. The GNU operating system has been developed so that users can have freedom
  18303. in their computing. GNU is @dfn{free software}, meaning that users have the
  18304. @url{http://www.gnu.org/philosophy/free-sw.html,four essential freedoms}: to
  18305. run the program, to study and change the program in source code form, to
  18306. redistribute exact copies, and to distribute modified versions. Packages
  18307. found in the GNU distribution provide only software that conveys these four
  18308. freedoms.
  18309. In addition, the GNU distribution follow the
  18310. @url{http://www.gnu.org/distros/free-system-distribution-guidelines.html,free
  18311. software distribution guidelines}. Among other things, these guidelines
  18312. reject non-free firmware, recommendations of non-free software, and discuss
  18313. ways to deal with trademarks and patents.
  18314. Some otherwise free upstream package sources contain a small and optional
  18315. subset that violates the above guidelines, for instance because this subset
  18316. is itself non-free code. When that happens, the offending items are removed
  18317. with appropriate patches or code snippets in the @code{origin} form of the
  18318. package (@pxref{Pakete definieren}). This way, @code{guix build --source}
  18319. returns the ``freed'' source rather than the unmodified upstream source.
  18320. @node Paketbenennung
  18321. @subsection Paketbenennung
  18322. @cindex package name
  18323. A package has actually two names associated with it: First, there is the
  18324. name of the @emph{Scheme variable}, the one following @code{define-public}.
  18325. By this name, the package can be made known in the Scheme code, for instance
  18326. as input to another package. Second, there is the string in the @code{name}
  18327. field of a package definition. This name is used by package management
  18328. commands such as @command{guix package} and @command{guix build}.
  18329. Both are usually the same and correspond to the lowercase conversion of the
  18330. project name chosen upstream, with underscores replaced with hyphens. For
  18331. instance, GNUnet is available as @code{gnunet}, and SDL_net as
  18332. @code{sdl-net}.
  18333. We do not add @code{lib} prefixes for library packages, unless these are
  18334. already part of the official project name. But @pxref{Python-Module} and
  18335. @ref{Perl-Module} for special rules concerning modules for the Python and
  18336. Perl languages.
  18337. Font package names are handled differently, @pxref{Schriftarten}.
  18338. @node Versionsnummern
  18339. @subsection Versionsnummern
  18340. @cindex package version
  18341. We usually package only the latest version of a given free software
  18342. project. But sometimes, for instance for incompatible library versions, two
  18343. (or more) versions of the same package are needed. These require different
  18344. Scheme variable names. We use the name as defined in @ref{Paketbenennung}
  18345. for the most recent version; previous versions use the same name, suffixed
  18346. by @code{-} and the smallest prefix of the version number that may
  18347. distinguish the two versions.
  18348. The name inside the package definition is the same for all versions of a
  18349. package and does not contain any version number.
  18350. For instance, the versions 2.24.20 and 3.9.12 of GTK+ may be packaged as
  18351. follows:
  18352. @example
  18353. (define-public gtk+
  18354. (package
  18355. (name "gtk+")
  18356. (version "3.9.12")
  18357. ...))
  18358. (define-public gtk+-2
  18359. (package
  18360. (name "gtk+")
  18361. (version "2.24.20")
  18362. ...))
  18363. @end example
  18364. If we also wanted GTK+ 3.8.2, this would be packaged as
  18365. @example
  18366. (define-public gtk+-3.8
  18367. (package
  18368. (name "gtk+")
  18369. (version "3.8.2")
  18370. ...))
  18371. @end example
  18372. @c See <https://lists.gnu.org/archive/html/guix-devel/2016-01/msg00425.html>,
  18373. @c for a discussion of what follows.
  18374. @cindex version number, for VCS snapshots
  18375. Occasionally, we package snapshots of upstream's version control system
  18376. (VCS) instead of formal releases. This should remain exceptional, because
  18377. it is up to upstream developers to clarify what the stable release is. Yet,
  18378. it is sometimes necessary. So, what should we put in the @code{version}
  18379. field?
  18380. Clearly, we need to make the commit identifier of the VCS snapshot visible
  18381. in the version string, but we also need to make sure that the version string
  18382. is monotonically increasing so that @command{guix package --upgrade} can
  18383. determine which version is newer. Since commit identifiers, notably with
  18384. Git, are not monotonically increasing, we add a revision number that we
  18385. increase each time we upgrade to a newer snapshot. The resulting version
  18386. string looks like this:
  18387. @example
  18388. 2.0.11-3.cabba9e
  18389. ^ ^ ^
  18390. | | `-- upstream commit ID
  18391. | |
  18392. | `--- Guix package revision
  18393. |
  18394. latest upstream version
  18395. @end example
  18396. It is a good idea to strip commit identifiers in the @code{version} field
  18397. to, say, 7 digits. It avoids an aesthetic annoyance (assuming aesthetics
  18398. have a role to play here) as well as problems related to OS limits such as
  18399. the maximum shebang length (127 bytes for the Linux kernel.) It is best to
  18400. use the full commit identifiers in @code{origin}s, though, to avoid
  18401. ambiguities. A typical package definition may look like this:
  18402. @example
  18403. (define my-package
  18404. (let ((commit "c3f29bc928d5900971f65965feaae59e1272a3f7")
  18405. (revision "1")) ;Guix package revision
  18406. (package
  18407. (version (git-version "0.9" revision commit))
  18408. (source (origin
  18409. (method git-fetch)
  18410. (uri (git-reference
  18411. (url "git://example.org/my-package.git")
  18412. (commit commit)))
  18413. (sha256 (base32 "1mbikn@dots{}"))
  18414. (file-name (git-file-name name version))))
  18415. ;; @dots{}
  18416. )))
  18417. @end example
  18418. @node Zusammenfassungen und Beschreibungen
  18419. @subsection Zusammenfassungen und Beschreibungen
  18420. @cindex package description
  18421. @cindex package synopsis
  18422. As we have seen before, each package in GNU@tie{}Guix includes a synopsis
  18423. and a description (@pxref{Pakete definieren}). Synopses and descriptions
  18424. are important: They are what @command{guix package --search} searches, and a
  18425. crucial piece of information to help users determine whether a given package
  18426. suits their needs. Consequently, packagers should pay attention to what
  18427. goes into them.
  18428. Synopses must start with a capital letter and must not end with a period.
  18429. They must not start with ``a'' or ``the'', which usually does not bring
  18430. anything; for instance, prefer ``File-frobbing tool'' over ``A tool that
  18431. frobs files''. The synopsis should say what the package is---e.g., ``Core
  18432. GNU utilities (file, text, shell)''---or what it is used for---e.g., the
  18433. synopsis for GNU@tie{}grep is ``Print lines matching a pattern''.
  18434. Keep in mind that the synopsis must be meaningful for a very wide audience.
  18435. For example, ``Manipulate alignments in the SAM format'' might make sense
  18436. for a seasoned bioinformatics researcher, but might be fairly unhelpful or
  18437. even misleading to a non-specialized audience. It is a good idea to come up
  18438. with a synopsis that gives an idea of the application domain of the
  18439. package. In this example, this might give something like ``Manipulate
  18440. nucleotide sequence alignments'', which hopefully gives the user a better
  18441. idea of whether this is what they are looking for.
  18442. Descriptions should take between five and ten lines. Use full sentences,
  18443. and avoid using acronyms without first introducing them. Please avoid
  18444. marketing phrases such as ``world-leading'', ``industrial-strength'', and
  18445. ``next-generation'', and avoid superlatives like ``the most
  18446. advanced''---they are not helpful to users looking for a package and may
  18447. even sound suspicious. Instead, try to be factual, mentioning use cases and
  18448. features.
  18449. @cindex Texinfo markup, in package descriptions
  18450. Descriptions can include Texinfo markup, which is useful to introduce
  18451. ornaments such as @code{@@code} or @code{@@dfn}, bullet lists, or hyperlinks
  18452. (@pxref{Overview,,, texinfo, GNU Texinfo}). However you should be careful
  18453. when using some characters for example @samp{@@} and curly braces which are
  18454. the basic special characters in Texinfo (@pxref{Special Characters,,,
  18455. texinfo, GNU Texinfo}). User interfaces such as @command{guix package
  18456. --show} take care of rendering it appropriately.
  18457. Synopses and descriptions are translated by volunteers
  18458. @uref{http://translationproject.org/domain/guix-packages.html, at the
  18459. Translation Project} so that as many users as possible can read them in
  18460. their native language. User interfaces search them and display them in the
  18461. language specified by the current locale.
  18462. To allow @command{xgettext} to extract them as translatable strings,
  18463. synopses and descriptions @emph{must be literal strings}. This means that
  18464. you cannot use @code{string-append} or @code{format} to construct these
  18465. strings:
  18466. @lisp
  18467. (package
  18468. ;; @dots{}
  18469. (synopsis "This is translatable")
  18470. (description (string-append "This is " "*not*" " translatable.")))
  18471. @end lisp
  18472. Translation is a lot of work so, as a packager, please pay even more
  18473. attention to your synopses and descriptions as every change may entail
  18474. additional work for translators. In order to help them, it is possible to
  18475. make recommendations or instructions visible to them by inserting special
  18476. comments like this (@pxref{xgettext Invocation,,, gettext, GNU Gettext}):
  18477. @example
  18478. ;; TRANSLATORS: "X11 resize-and-rotate" should not be translated.
  18479. (description "ARandR is designed to provide a simple visual front end
  18480. for the X11 resize-and-rotate (RandR) extension. @dots{}")
  18481. @end example
  18482. @node Python-Module
  18483. @subsection Python-Module
  18484. @cindex python
  18485. We currently package Python 2 and Python 3, under the Scheme variable names
  18486. @code{python-2} and @code{python} as explained in @ref{Versionsnummern}. To
  18487. avoid confusion and naming clashes with other programming languages, it
  18488. seems desirable that the name of a package for a Python module contains the
  18489. word @code{python}.
  18490. Some modules are compatible with only one version of Python, others with
  18491. both. If the package Foo compiles only with Python 3, we name it
  18492. @code{python-foo}; if it compiles only with Python 2, we name it
  18493. @code{python2-foo}. If it is compatible with both versions, we create two
  18494. packages with the corresponding names.
  18495. If a project already contains the word @code{python}, we drop this; for
  18496. instance, the module python-dateutil is packaged under the names
  18497. @code{python-dateutil} and @code{python2-dateutil}. If the project name
  18498. starts with @code{py} (e.g.@: @code{pytz}), we keep it and prefix it as
  18499. described above.
  18500. @subsubsection Specifying Dependencies
  18501. @cindex inputs, for Python packages
  18502. Dependency information for Python packages is usually available in the
  18503. package source tree, with varying degrees of accuracy: in the
  18504. @file{setup.py} file, in @file{requirements.txt}, or in @file{tox.ini}.
  18505. Your mission, when writing a recipe for a Python package, is to map these
  18506. dependencies to the appropriate type of ``input'' (@pxref{„package“-Referenz,
  18507. inputs}). Although the @code{pypi} importer normally does a good job
  18508. (@pxref{Aufruf von guix import}), you may want to check the following check
  18509. list to determine which dependency goes where.
  18510. @itemize
  18511. @item
  18512. We currently package Python 2 with @code{setuptools} and @code{pip}
  18513. installed like Python 3.4 has per default. Thus you don't need to specify
  18514. either of these as an input. @command{guix lint} will warn you if you do.
  18515. @item
  18516. Python dependencies required at run time go into @code{propagated-inputs}.
  18517. They are typically defined with the @code{install_requires} keyword in
  18518. @file{setup.py}, or in the @file{requirements.txt} file.
  18519. @item
  18520. Python packages required only at build time---e.g., those listed with the
  18521. @code{setup_requires} keyword in @file{setup.py}---or only for
  18522. testing---e.g., those in @code{tests_require}---go into
  18523. @code{native-inputs}. The rationale is that (1) they do not need to be
  18524. propagated because they are not needed at run time, and (2) in a
  18525. cross-compilation context, it's the ``native'' input that we'd want.
  18526. Examples are the @code{pytest}, @code{mock}, and @code{nose} test
  18527. frameworks. Of course if any of these packages is also required at
  18528. run-time, it needs to go to @code{propagated-inputs}.
  18529. @item
  18530. Anything that does not fall in the previous categories goes to
  18531. @code{inputs}, for example programs or C libraries required for building
  18532. Python packages containing C extensions.
  18533. @item
  18534. If a Python package has optional dependencies (@code{extras_require}), it is
  18535. up to you to decide whether to add them or not, based on their
  18536. usefulness/overhead ratio (@pxref{Einreichen von Patches, @command{guix size}}).
  18537. @end itemize
  18538. @node Perl-Module
  18539. @subsection Perl-Module
  18540. @cindex perl
  18541. Perl programs standing for themselves are named as any other package, using
  18542. the lowercase upstream name. For Perl packages containing a single class,
  18543. we use the lowercase class name, replace all occurrences of @code{::} by
  18544. dashes and prepend the prefix @code{perl-}. So the class @code{XML::Parser}
  18545. becomes @code{perl-xml-parser}. Modules containing several classes keep
  18546. their lowercase upstream name and are also prepended by @code{perl-}. Such
  18547. modules tend to have the word @code{perl} somewhere in their name, which
  18548. gets dropped in favor of the prefix. For instance, @code{libwww-perl}
  18549. becomes @code{perl-libwww}.
  18550. @node Java-Pakete
  18551. @subsection Java-Pakete
  18552. @cindex java
  18553. Java programs standing for themselves are named as any other package, using
  18554. the lowercase upstream name.
  18555. To avoid confusion and naming clashes with other programming languages, it
  18556. is desirable that the name of a package for a Java package is prefixed with
  18557. @code{java-}. If a project already contains the word @code{java}, we drop
  18558. this; for instance, the package @code{ngsjava} is packaged under the name
  18559. @code{java-ngs}.
  18560. For Java packages containing a single class or a small class hierarchy, we
  18561. use the lowercase class name, replace all occurrences of @code{.} by dashes
  18562. and prepend the prefix @code{java-}. So the class @code{apache.commons.cli}
  18563. becomes package @code{java-apache-commons-cli}.
  18564. @node Schriftarten
  18565. @subsection Schriftarten
  18566. @cindex Schriftarten
  18567. For fonts that are in general not installed by a user for typesetting
  18568. purposes, or that are distributed as part of a larger software package, we
  18569. rely on the general packaging rules for software; for instance, this applies
  18570. to the fonts delivered as part of the X.Org system or fonts that are part of
  18571. TeX Live.
  18572. To make it easier for a user to search for fonts, names for other packages
  18573. containing only fonts are constructed as follows, independently of the
  18574. upstream package name.
  18575. The name of a package containing only one font family starts with
  18576. @code{font-}; it is followed by the foundry name and a dash @code{-} if the
  18577. foundry is known, and the font family name, in which spaces are replaced by
  18578. dashes (and as usual, all upper case letters are transformed to lower
  18579. case). For example, the Gentium font family by SIL is packaged under the
  18580. name @code{font-sil-gentium}.
  18581. For a package containing several font families, the name of the collection
  18582. is used in the place of the font family name. For instance, the Liberation
  18583. fonts consist of three families, Liberation Sans, Liberation Serif and
  18584. Liberation Mono. These could be packaged separately under the names
  18585. @code{font-liberation-sans} and so on; but as they are distributed together
  18586. under a common name, we prefer to package them together as
  18587. @code{font-liberation}.
  18588. In the case where several formats of the same font family or font collection
  18589. are packaged separately, a short form of the format, prepended by a dash, is
  18590. added to the package name. We use @code{-ttf} for TrueType fonts,
  18591. @code{-otf} for OpenType fonts and @code{-type1} for PostScript Type 1
  18592. fonts.
  18593. @node Bootstrapping
  18594. @section Bootstrapping
  18595. @c Adapted from the ELS 2013 paper.
  18596. @cindex bootstrapping
  18597. Bootstrapping in our context refers to how the distribution gets built
  18598. ``from nothing''. Remember that the build environment of a derivation
  18599. contains nothing but its declared inputs (@pxref{Einführung}). So there's
  18600. an obvious chicken-and-egg problem: how does the first package get built?
  18601. How does the first compiler get compiled? Note that this is a question of
  18602. interest only to the curious hacker, not to the regular user, so you can
  18603. shamelessly skip this section if you consider yourself a ``regular user''.
  18604. @cindex bootstrap binaries
  18605. The GNU system is primarily made of C code, with libc at its core. The GNU
  18606. build system itself assumes the availability of a Bourne shell and
  18607. command-line tools provided by GNU Coreutils, Awk, Findutils, `sed', and
  18608. `grep'. Furthermore, build programs---programs that run @code{./configure},
  18609. @code{make}, etc.---are written in Guile Scheme (@pxref{Ableitungen}).
  18610. Consequently, to be able to build anything at all, from scratch, Guix relies
  18611. on pre-built binaries of Guile, GCC, Binutils, libc, and the other packages
  18612. mentioned above---the @dfn{bootstrap binaries}.
  18613. These bootstrap binaries are ``taken for granted'', though we can also
  18614. re-create them if needed (more on that later).
  18615. @unnumberedsubsec Preparing to Use the Bootstrap Binaries
  18616. @c As of Emacs 24.3, Info-mode displays the image, but since it's a
  18617. @c large image, it's hard to scroll. Oh well.
  18618. @image{images/bootstrap-graph,6in,,Dependency graph of the early bootstrap
  18619. derivations}
  18620. The figure above shows the very beginning of the dependency graph of the
  18621. distribution, corresponding to the package definitions of the @code{(gnu
  18622. packages bootstrap)} module. A similar figure can be generated with
  18623. @command{guix graph} (@pxref{Aufruf von guix graph}), along the lines of:
  18624. @example
  18625. guix graph -t derivation \
  18626. -e '(@@@@ (gnu packages bootstrap) %bootstrap-gcc)' \
  18627. | dot -Tps > t.ps
  18628. @end example
  18629. At this level of detail, things are slightly complex. First, Guile itself
  18630. consists of an ELF executable, along with many source and compiled Scheme
  18631. files that are dynamically loaded when it runs. This gets stored in the
  18632. @file{guile-2.0.7.tar.xz} tarball shown in this graph. This tarball is part
  18633. of Guix's ``source'' distribution, and gets inserted into the store with
  18634. @code{add-to-store} (@pxref{Der Store}).
  18635. But how do we write a derivation that unpacks this tarball and adds it to
  18636. the store? To solve this problem, the @code{guile-bootstrap-2.0.drv}
  18637. derivation---the first one that gets built---uses @code{bash} as its
  18638. builder, which runs @code{build-bootstrap-guile.sh}, which in turn calls
  18639. @code{tar} to unpack the tarball. Thus, @file{bash}, @file{tar}, @file{xz},
  18640. and @file{mkdir} are statically-linked binaries, also part of the Guix
  18641. source distribution, whose sole purpose is to allow the Guile tarball to be
  18642. unpacked.
  18643. Once @code{guile-bootstrap-2.0.drv} is built, we have a functioning Guile
  18644. that can be used to run subsequent build programs. Its first task is to
  18645. download tarballs containing the other pre-built binaries---this is what the
  18646. @code{.tar.xz.drv} derivations do. Guix modules such as
  18647. @code{ftp-client.scm} are used for this purpose. The
  18648. @code{module-import.drv} derivations import those modules in a directory in
  18649. the store, using the original layout. The @code{module-import-compiled.drv}
  18650. derivations compile those modules, and write them in an output directory
  18651. with the right layout. This corresponds to the @code{#:modules} argument of
  18652. @code{build-expression->derivation} (@pxref{Ableitungen}).
  18653. Finally, the various tarballs are unpacked by the derivations
  18654. @code{gcc-bootstrap-0.drv}, @code{glibc-bootstrap-0.drv}, etc., at which
  18655. point we have a working C tool chain.
  18656. @unnumberedsubsec Building the Build Tools
  18657. Bootstrapping is complete when we have a full tool chain that does not
  18658. depend on the pre-built bootstrap tools discussed above. This no-dependency
  18659. requirement is verified by checking whether the files of the final tool
  18660. chain contain references to the @file{/gnu/store} directories of the
  18661. bootstrap inputs. The process that leads to this ``final'' tool chain is
  18662. described by the package definitions found in the @code{(gnu packages
  18663. commencement)} module.
  18664. The @command{guix graph} command allows us to ``zoom out'' compared to the
  18665. graph above, by looking at the level of package objects instead of
  18666. individual derivations---remember that a package may translate to several
  18667. derivations, typically one derivation to download its source, one to build
  18668. the Guile modules it needs, and one to actually build the package from
  18669. source. The command:
  18670. @example
  18671. guix graph -t bag \
  18672. -e '(@@@@ (gnu packages commencement)
  18673. glibc-final-with-bootstrap-bash)' | dot -Tps > t.ps
  18674. @end example
  18675. @noindent
  18676. produces the dependency graph leading to the ``final'' C
  18677. library@footnote{You may notice the @code{glibc-intermediate} label,
  18678. suggesting that it is not @emph{quite} final, but as a good approximation,
  18679. we will consider it final.}, depicted below.
  18680. @image{images/bootstrap-packages,6in,,Dependency graph of the early
  18681. packages}
  18682. @c See <http://lists.gnu.org/archive/html/gnu-system-discuss/2012-10/msg00000.html>.
  18683. The first tool that gets built with the bootstrap binaries is
  18684. GNU@tie{}Make---noted @code{make-boot0} above---which is a prerequisite for
  18685. all the following packages. From there Findutils and Diffutils get built.
  18686. Then come the first-stage Binutils and GCC, built as pseudo cross
  18687. tools---i.e., with @code{--target} equal to @code{--host}. They are used to
  18688. build libc. Thanks to this cross-build trick, this libc is guaranteed not
  18689. to hold any reference to the initial tool chain.
  18690. From there the final Binutils and GCC (not shown above) are built. GCC uses
  18691. @code{ld} from the final Binutils, and links programs against the just-built
  18692. libc. This tool chain is used to build the other packages used by Guix and
  18693. by the GNU Build System: Guile, Bash, Coreutils, etc.
  18694. And voilà! At this point we have the complete set of build tools that the
  18695. GNU Build System expects. These are in the @code{%final-inputs} variable of
  18696. the @code{(gnu packages commencement)} module, and are implicitly used by
  18697. any package that uses @code{gnu-build-system} (@pxref{Erstellungssysteme,
  18698. @code{gnu-build-system}}).
  18699. @unnumberedsubsec Building the Bootstrap Binaries
  18700. @cindex bootstrap binaries
  18701. Because the final tool chain does not depend on the bootstrap binaries,
  18702. those rarely need to be updated. Nevertheless, it is useful to have an
  18703. automated way to produce them, should an update occur, and this is what the
  18704. @code{(gnu packages make-bootstrap)} module provides.
  18705. The following command builds the tarballs containing the bootstrap binaries
  18706. (Guile, Binutils, GCC, libc, and a tarball containing a mixture of Coreutils
  18707. and other basic command-line tools):
  18708. @example
  18709. guix build bootstrap-tarballs
  18710. @end example
  18711. The generated tarballs are those that should be referred to in the
  18712. @code{(gnu packages bootstrap)} module mentioned at the beginning of this
  18713. section.
  18714. Still here? Then perhaps by now you've started to wonder: when do we reach a
  18715. fixed point? That is an interesting question! The answer is unknown, but if
  18716. you would like to investigate further (and have significant computational
  18717. and storage resources to do so), then let us know.
  18718. @unnumberedsubsec Reducing the Set of Bootstrap Binaries
  18719. Our bootstrap binaries currently include GCC, Guile, etc. That's a lot of
  18720. binary code! Why is that a problem? It's a problem because these big chunks
  18721. of binary code are practically non-auditable, which makes it hard to
  18722. establish what source code produced them. Every unauditable binary also
  18723. leaves us vulnerable to compiler backdoors as described by Ken Thompson in
  18724. the 1984 paper @emph{Reflections on Trusting Trust}.
  18725. This is mitigated by the fact that our bootstrap binaries were generated
  18726. from an earlier Guix revision. Nevertheless it lacks the level of
  18727. transparency that we get in the rest of the package dependency graph, where
  18728. Guix always gives us a source-to-binary mapping. Thus, our goal is to
  18729. reduce the set of bootstrap binaries to the bare minimum.
  18730. The @uref{http://bootstrappable.org, Bootstrappable.org web site} lists
  18731. on-going projects to do that. One of these is about replacing the bootstrap
  18732. GCC with a sequence of assemblers, interpreters, and compilers of increasing
  18733. complexity, which could be built from source starting from a simple and
  18734. auditable assembler. Your help is welcome!
  18735. @node Portierung
  18736. @section Porting to a New Platform
  18737. As discussed above, the GNU distribution is self-contained, and
  18738. self-containment is achieved by relying on pre-built ``bootstrap binaries''
  18739. (@pxref{Bootstrapping}). These binaries are specific to an operating system
  18740. kernel, CPU architecture, and application binary interface (ABI). Thus, to
  18741. port the distribution to a platform that is not yet supported, one must
  18742. build those bootstrap binaries, and update the @code{(gnu packages
  18743. bootstrap)} module to use them on that platform.
  18744. Fortunately, Guix can @emph{cross compile} those bootstrap binaries. When
  18745. everything goes well, and assuming the GNU tool chain supports the target
  18746. platform, this can be as simple as running a command like this one:
  18747. @example
  18748. guix build --target=armv5tel-linux-gnueabi bootstrap-tarballs
  18749. @end example
  18750. For this to work, the @code{glibc-dynamic-linker} procedure in @code{(gnu
  18751. packages bootstrap)} must be augmented to return the right file name for
  18752. libc's dynamic linker on that platform; likewise,
  18753. @code{system->linux-architecture} in @code{(gnu packages linux)} must be
  18754. taught about the new platform.
  18755. Once these are built, the @code{(gnu packages bootstrap)} module needs to be
  18756. updated to refer to these binaries on the target platform. That is, the
  18757. hashes and URLs of the bootstrap tarballs for the new platform must be added
  18758. alongside those of the currently supported platforms. The bootstrap Guile
  18759. tarball is treated specially: it is expected to be available locally, and
  18760. @file{gnu/local.mk} has rules to download it for the supported
  18761. architectures; a rule for the new platform must be added as well.
  18762. In practice, there may be some complications. First, it may be that the
  18763. extended GNU triplet that specifies an ABI (like the @code{eabi} suffix
  18764. above) is not recognized by all the GNU tools. Typically, glibc recognizes
  18765. some of these, whereas GCC uses an extra @code{--with-abi} configure flag
  18766. (see @code{gcc.scm} for examples of how to handle this). Second, some of
  18767. the required packages could fail to build for that platform. Lastly, the
  18768. generated binaries could be broken for some reason.
  18769. @c *********************************************************************
  18770. @include contributing.de.texi
  18771. @c *********************************************************************
  18772. @node Danksagungen
  18773. @chapter Danksagungen
  18774. Guix is based on the @uref{http://nixos.org/nix/, Nix package manager},
  18775. which was designed and implemented by Eelco Dolstra, with contributions from
  18776. other people (see the @file{nix/AUTHORS} file in Guix.) Nix pioneered
  18777. functional package management, and promoted unprecedented features, such as
  18778. transactional package upgrades and rollbacks, per-user profiles, and
  18779. referentially transparent build processes. Without this work, Guix would
  18780. not exist.
  18781. The Nix-based software distributions, Nixpkgs and NixOS, have also been an
  18782. inspiration for Guix.
  18783. GNU@tie{}Guix itself is a collective work with contributions from a number
  18784. of people. See the @file{AUTHORS} file in Guix for more information on
  18785. these fine people. The @file{THANKS} file lists people who have helped by
  18786. reporting bugs, taking care of the infrastructure, providing artwork and
  18787. themes, making suggestions, and more---thank you!
  18788. @c *********************************************************************
  18789. @node GNU-Lizenz für freie Dokumentation
  18790. @appendix GNU-Lizenz für freie Dokumentation
  18791. @cindex license, GNU Free Documentation License
  18792. @include fdl-1.3.texi
  18793. @c *********************************************************************
  18794. @node Konzeptverzeichnis
  18795. @unnumbered Konzeptverzeichnis
  18796. @printindex cp
  18797. @node Programmierverzeichnis
  18798. @unnumbered Programmierverzeichnis
  18799. @syncodeindex tp fn
  18800. @syncodeindex vr fn
  18801. @printindex fn
  18802. @bye
  18803. @c Local Variables:
  18804. @c ispell-local-dictionary: "american";
  18805. @c End: