emacs-guix.texi 55 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735
  1. \input texinfo
  2. @setfilename emacs-guix.info
  3. @documentencoding UTF-8
  4. @settitle Emacs-Guix Reference Manual
  5. @copying
  6. This document describes Emacs-Guix, the Emacs interface for the
  7. @uref{https://www.gnu.org/software/guix/, GNU Guix} package manager.
  8. @quotation
  9. Copyright @copyright{} 2014-2018 Alex Kost@*
  10. Copyright @copyright{} 2018 Oleg Pykhalov
  11. Permission is granted to copy, distribute and/or modify this document
  12. under the terms of the GNU Free Documentation License, Version 1.3
  13. or any later version published by the Free Software Foundation;
  14. with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
  15. A copy of the license is available at
  16. @url{http://www.gnu.org/licenses/fdl.html}.
  17. @end quotation
  18. @end copying
  19. @dircategory Emacs
  20. @direntry
  21. * Emacs-Guix: (Emacs-Guix). Emacs interface for GNU Guix
  22. @end direntry
  23. @titlepage
  24. @title Emacs-Guix User Manual
  25. @author Alex Kost
  26. @page
  27. @vskip 0pt plus 1filll
  28. @insertcopying
  29. @end titlepage
  30. @contents
  31. @c ----------------------------------------------------------------
  32. @node Top
  33. @top Emacs-Guix
  34. @insertcopying
  35. @menu
  36. * Introduction:: Quick overview.
  37. * Installation:: Installing Emacs-Guix.
  38. * Packages:: Interface for packages.
  39. * Profiles and Generations:: Interface for profiles and their generations.
  40. * System:: Interface for @code{operating-system} and services.
  41. * Package Licenses:: Interface for licenses of packages.
  42. * Popup Interface:: Magit-like interface for guix commands.
  43. * Prettify Mode:: Abbreviating @file{/gnu/store/@dots{}} file names.
  44. * Prettify Variables:: Split and indent Shell variables.
  45. * Build Log Mode:: Highlighting Guix build logs.
  46. * Completions:: Completing @command{guix} shell command.
  47. * Development:: Highlighting and tools for Guix code.
  48. * Hydra:: Interface for the Guix build farm.
  49. * List/Info Interface:: Describing ``list''/''info'' buffers.
  50. * Configuration:: Configuring Emacs-Guix.
  51. * Miscellaneous Commands:: @kbd{M-x guix-@dots{}} uncovered by other sections.
  52. * Help:: Help commands.
  53. Indexes
  54. * Concept Index:: Concepts.
  55. * Command Index:: Commands and functions.
  56. * Variable Index:: Variables.
  57. @end menu
  58. @c ----------------------------------------------------------------
  59. @node Introduction
  60. @chapter Introduction
  61. Emacs-Guix (also known as ``guix.el'') provides various interfaces and
  62. tools related to the GNU Guix package manager.
  63. @findex guix-about
  64. Call @kbd{M-x guix-about} to see a splash screen similar to
  65. @kbd{M-x@tie{}about-emacs}.
  66. Call @kbd{M-x guix-help} to get a summary of all the available
  67. commands (@pxref{Help}).
  68. In short, Emacs-Guix provides the following features:
  69. @itemize @bullet
  70. @item
  71. Interfaces for:
  72. @itemize @minus
  73. @item profiles (@pxref{Profiles})
  74. @item profile generations (@pxref{Generations})
  75. @item packages (@pxref{Packages})
  76. @item package locations (@pxref{Package Locations})
  77. @item package licenses (@pxref{Package Licenses})
  78. @item @code{operating-system} declaration (@pxref{System From File})
  79. @item services (@pxref{Services})
  80. @item service locations (@pxref{Service Locations})
  81. @item @uref{https://hydra.gnu.org, Hydra build farm} (@pxref{Hydra})
  82. @end itemize
  83. @item
  84. Magit-like popup interface for all guix shell commands
  85. (@pxref{Popup Interface}).
  86. @item
  87. Modes to view logs of package builds (@pxref{Build Log Mode}).
  88. @item
  89. Minor mode to ``prettify'' store file names (@pxref{Prettify Mode}).
  90. @item
  91. Shell completions for all guix commands and options
  92. (@pxref{Completions}).
  93. @item
  94. Minor mode with additional functionality for @code{scheme-mode} to
  95. work with Guix Scheme files (@pxref{Development}).
  96. @end itemize
  97. @c ----------------------------------------------------------------
  98. @node Installation
  99. @chapter Installation
  100. @cindex installation
  101. There are several ways@footnote{It is not recommended to mix several
  102. installations (in particular, installations from Guix and MELPA), as
  103. it may lead to incompatibilities in the source (@code{.scm}) and
  104. compiled (@code{.go}) Guile files.} to install Emacs-Guix:
  105. @itemize
  106. @item Installing using GNU Guix
  107. @example
  108. $ guix package -i emacs-guix
  109. @end example
  110. @item Installing from @uref{http://melpa.org/, MELPA}
  111. @item Using from a git checkout
  112. @end itemize
  113. For the first 2 options, you are all set, so you can skip this
  114. chapter. If you want to use Emacs-Guix from a git checkout, read
  115. further.
  116. @menu
  117. * Requirements:: Required and optional dependencies.
  118. * Using from Git:: Using without installation.
  119. @end menu
  120. @node Requirements
  121. @section Requirements
  122. Emacs-Guix depends on the following packages:
  123. @itemize
  124. @item
  125. @uref{http://www.gnu.org/software/emacs/, GNU Emacs}, version 24.3 or
  126. later.
  127. @item
  128. @uref{http://www.gnu.org/software/guix/, GNU Guix}, version 0.11.0 or
  129. later. You need it for the most features of Emacs-Guix, but not for
  130. all: Guix is not needed if you want to look at log files (@pxref{Build
  131. Log Mode}), to ``prettify'' store file names (@pxref{Prettify Mode}),
  132. or to receive some info from Hydra (@pxref{Hydra}).
  133. @item
  134. @uref{http://nongnu.org/geiser/, Geiser}, version 0.8 or later. It is
  135. used to communicate with the Guix daemon, and to receive various info
  136. from the Guix Guile code. So without Geiser, you can use the same
  137. features as without Guix.
  138. @item
  139. @uref{https://github.com/magnars/dash.el, dash library}, version
  140. 2.11.0 or later.
  141. @item
  142. @uref{https://gitlab.com/alezost-emacs/bui, BUI library}, version
  143. 1.1.0 or later. It is used to define various ``list''/``info''
  144. interfaces (to display packages, generations, licenses, etc.).
  145. @item
  146. @uref{https://github.com/magit/magit, magit-popup library}. You
  147. already have this library if you use Magit 2.1.0 or later. This
  148. library is required only for @kbd{M-x@tie{}guix} command (@pxref{Popup
  149. Interface}).
  150. @item
  151. @uref{https://github.com/Fanael/edit-indirect, edit-indirect library},
  152. version 0.1.4 or later. It is used only to edit synopsis/description
  153. in @code{guix-devel-mode} (@pxref{Development}).
  154. @end itemize
  155. To sum up, most likely, you'll need all the above dependencies except
  156. maybe @code{magit-popup} and @code{edit-indirect}.
  157. @node Using from Git
  158. @section Using from Git
  159. You can use Emacs-Guix directly from a git checkout without any
  160. installation.
  161. At first, you need to clone the repository and to run
  162. @code{autogen.sh} script (it's just a wrapper for @code{autoreconf}
  163. command). If you don't have all dependencies installed, you may use
  164. @file{guix.scm} file to make an environment to build Emacs-Guix
  165. (@pxref{Invoking guix environment,,, guix, The GNU Guix Reference
  166. Manual}):
  167. @example
  168. $ git clone https://notabug.org/alezost/emacs-guix.git
  169. $ cd guix.el
  170. $ guix environment --pure --load=guix.scm
  171. $ ./autogen.sh
  172. @end example
  173. Now configure and make it (this will compile all Emacs-Lisp and Scheme
  174. files, and will generate @file{guix-autoloads.el} file):
  175. @example
  176. $ ./configure
  177. $ make
  178. @end example
  179. Now all you need, is to add @file{elisp} directory to the Emacs
  180. @code{load-path} and to load the generated autoloads. This can be
  181. done by adding the following code into your Emacs init file
  182. (@pxref{Init File,,, emacs, The GNU Emacs Manual}):
  183. @example
  184. (add-to-list 'load-path "/path/to/emacs-guix/elisp")
  185. (require 'guix-autoloads nil t)
  186. @end example
  187. Now, if you start Emacs, all @kbd{M-x guix-@dots{}} commands should
  188. become available.
  189. @node Using the Manual from Git
  190. @subsection Using the Manual from Git
  191. After ``make''-ing, the info manual is ready to use. You can run it,
  192. for example, with @kbd{C-u C-h i} command (the file is
  193. @file{doc/emacs-guix.info}). However it is not convenient. You may
  194. want to have this manual in the top info directory along with the
  195. other manuals. To make it possible, you need to do the following 2
  196. steps:
  197. @itemize
  198. @item
  199. At first, you need to add the doc directory to your Info path. One
  200. way to do it is to extend INFOPATH environment variable:
  201. @example
  202. export INFOPATH="/path/to/emacs-guix/doc$@{INFOPATH:+:@}$INFOPATH"
  203. @end example
  204. Alternatively, you can adjust Info path inside Emacs, like this:
  205. @example
  206. (with-eval-after-load 'info
  207. (info-initialize)
  208. (add-to-list 'Info-directory-list "/path/to/emacs-guix/doc"))
  209. @end example
  210. @item
  211. And secondly, the doc directory should contain @file{dir} file
  212. (@pxref{Directory File,,, texinfo, The GNU Texinfo Manual}). It can
  213. be generated simply by running the following command:
  214. @example
  215. make doc/dir
  216. @end example
  217. @end itemize
  218. Once the above 2 steps are done, @kbd{C-h i} should display the
  219. Emacs-Guix entry. Also you can use @kbd{M-x guix-info} command to run
  220. the manual (@pxref{Help}).
  221. @c ----------------------------------------------------------------
  222. @node Packages
  223. @chapter Packages
  224. @cindex packages
  225. Emacs-Guix provides a visual interface for packages where you can
  226. perform routine package management tasks, pretty much like the
  227. @command{guix package} command (@pxref{Invoking guix package,,, guix,
  228. The GNU Guix Reference Manual}).
  229. @menu
  230. * Package Commands:: @kbd{M-x guix-@dots{}} to show packages.
  231. * Package Keys:: Key bindings in package ``list'' and ``info'' buffers.
  232. * Package Locations:: Interface for locations of packages.
  233. * More Package Commands:: Other @kbd{M-x guix-@dots{}} related to packages.
  234. @end menu
  235. @node Package Commands
  236. @section Package Commands
  237. There are multiple commands to display a list of Guix packages. You
  238. can either perform some actions in such ``package-list'' buffer, or
  239. ``describe'' package(s) in ``package-info'' buffer using
  240. @kbd{@key{RET}}.
  241. @findex guix-set-current-profile
  242. The following commands use the current profile, which can be changed
  243. globally with @kbd{M-x@tie{}guix-set-current-profile} (@pxref{Profile
  244. Commands}). Alternatively, if you call any of the following commands
  245. with a prefix argument (@kbd{C-u}), you will be prompted for a profile
  246. just for that command.
  247. @table @kbd
  248. @findex guix-all-packages
  249. @item M-x guix-all-packages
  250. @findex guix-newest-packages
  251. @itemx M-x guix-newest-packages
  252. Display all/newest available packages.
  253. @findex guix-installed-packages
  254. @item M-x guix-installed-packages
  255. @findex guix-installed-user-packages
  256. @itemx M-x guix-installed-user-packages
  257. @findex guix-installed-system-packages
  258. @itemx M-x guix-installed-system-packages
  259. Display installed packages. As explained above, @kbd{M-x
  260. guix-installed-packages} uses an arbitrary profile that you can specify,
  261. while the other commands display packages installed in 2 special
  262. profiles: @file{~/.guix-profile} and @file{/run/current-system/profile}
  263. (only on GuixSD).
  264. @findex guix-obsolete-packages
  265. @item M-x guix-obsolete-packages
  266. Display obsolete or unknown packages (the packages that are installed
  267. in a profile but cannot be found among the available packages).
  268. @findex guix-superseded-packages
  269. @item M-x guix-superseded-packages
  270. Display packages that are superseded by the other packages.
  271. @findex guix-dependent-packages
  272. @item M-x guix-dependent-packages
  273. Display packages that depend on the specified package(s). This
  274. command is analogous to @code{guix refresh --list-dependent} shell
  275. command (@pxref{Invoking guix refresh,,, guix, The GNU Guix Reference
  276. Manual}). You'll be prompted for a package name (or multiple names,
  277. separated by commas) and a dependency type (it should be either
  278. ``all'' or ``direct'').
  279. @findex guix-packages-by-name
  280. @item M-x guix-packages-by-name
  281. Display package(s) with the specified name.
  282. @findex guix-packages-by-license
  283. @item M-x guix-packages-by-license
  284. Display package(s) with the specified license.
  285. @findex guix-packages-by-location
  286. @item M-x guix-packages-by-location
  287. Display package(s) located in the specified file. These files usually
  288. have the following form: @file{gnu/packages/emacs.scm}, but don't type
  289. them manually! Press @kbd{@key{TAB}} to complete the file name.
  290. @findex guix-package-from-file
  291. @item M-x guix-package-from-file
  292. Display package that the code within the specified file evaluates to.
  293. @xref{Invoking guix package, @code{--install-from-file},, guix, The
  294. GNU Guix Reference Manual}, for an example of what such a file may
  295. look like.
  296. @findex guix-packages-from-system-config-file
  297. @item M-x guix-packages-from-system-config-file
  298. Display packages from the specified file with @code{operating-system}
  299. declaration (@pxref{Using the Configuration System,,, guix, The GNU
  300. Guix Reference Manual}).
  301. @findex guix-search-by-regexp
  302. @vindex guix-package-search-params
  303. @item M-x guix-search-by-regexp
  304. Search for packages by a specified regexp. By default, ``name'',
  305. ``synopsis'' and ``description'' of the packages will be searched. This
  306. can be changed by modifying @code{guix-package-search-params} variable.
  307. @findex guix-search-by-name
  308. @item M-x guix-search-by-name
  309. Search for packages with names matching a specified regexp. This
  310. command is the same as @code{guix-search-by-regexp}, except only a
  311. package ``name'' is searched.
  312. @end table
  313. @vindex guix-package-list-type
  314. By default, these commands display each package @strong{output} on a
  315. separate line. If you prefer to see a list of packages---i.e., a list
  316. with a @strong{package} per line, use the following setting:
  317. @example
  318. (setq guix-package-list-type 'package)
  319. @end example
  320. @node Package Keys
  321. @section Package Keys
  322. @subsection List Buffer
  323. Along with the general ``list'' keys (@pxref{List buffer}), a
  324. ``package-list'' buffer additionally provides the following key
  325. bindings:
  326. @table @kbd
  327. @item i
  328. Mark the current package for installation.
  329. @item d
  330. Mark the current package for deletion.
  331. @item U
  332. Mark the current package for upgrading.
  333. @item ^
  334. Mark all obsolete packages for upgrading (with prefix, mark all
  335. installed packages for upgrading).
  336. @item x
  337. Execute actions on the marked packages.
  338. @item e
  339. Edit the definition of the current package (go to its location). This
  340. is similar to @command{guix edit} command (@pxref{Invoking guix
  341. edit,,, guix, The GNU Guix Reference Manual}), but for opening a
  342. package recipe in the current Emacs instance.
  343. @item G
  344. @cindex graph
  345. Show graph for the current package (@pxref{Graph Configuration}).
  346. @item z
  347. Show package size (@pxref{Invoking guix size,,, guix, The GNU Guix
  348. Reference Manual}).
  349. @item L
  350. Lint the current package (@pxref{Invoking guix lint,,, guix, The GNU
  351. Guix Reference Manual}). With prefix argument, you'll be prompted for
  352. checker names.
  353. @item B
  354. Display latest builds of the current package (@pxref{Hydra}).
  355. @end table
  356. @subsection Info Buffer
  357. Similarly, ``package-info'' buffer provides the following key bindings:
  358. @table @kbd
  359. @item i
  360. Install the current package.
  361. @item d
  362. Delete the current package.
  363. @item U
  364. Upgrade the current package.
  365. @item e
  366. Go to the package definition.
  367. @item G
  368. Show package graph.
  369. @item z
  370. Show package size.
  371. @item L
  372. Lint the package.
  373. @end table
  374. @node Package Locations
  375. @section Package Locations
  376. @cindex package locations
  377. As you know, package definitions are placed in Guile files. The
  378. following commands should help you not get lost in these @dfn{package
  379. locations}:
  380. @table @kbd
  381. @findex guix-package-locations
  382. @item M-x guix-package-locations
  383. Display a list of files with package definitions. You can press @kbd{P}
  384. or @kbd{@key{RET}} there to display packages placed in the current file in
  385. the same way as @kbd{M-x@tie{}guix-packages-by-location} would do
  386. (@pxref{Package Commands}). Note that when the point is on a location
  387. button, @kbd{@key{RET}} will open this location file.
  388. @findex guix-find-package-location-file
  389. @item M-x guix-find-package-location-file
  390. Open a file with package definitions (press @kbd{@key{TAB}} to choose a
  391. file from the completion list).
  392. @findex guix-find-package-definition
  393. @item M-x guix-find-package-definition
  394. @findex guix-edit
  395. @itemx M-x guix-edit
  396. Find location of a specified package. This is an Emacs analog of
  397. @command{guix edit} command (@pxref{Invoking guix edit,,, guix, The
  398. GNU Guix Reference Manual}). As with
  399. @kbd{M-x@tie{}guix-packages-by-name}, you can press @kbd{@key{TAB}} to
  400. complete a package name.
  401. @end table
  402. @vindex guix-read-package-name-function
  403. By default, when you should specify a package name (for example, after
  404. @kbd{M-x guix-edit}), you will be prompted for it in the minibuffer,
  405. but you can configure Emacs-Guix to use a package name at the current
  406. point position (unless @kbd{C-u} is used):
  407. @example
  408. (setq guix-read-package-name-function 'guix-read-package-name-at-point)
  409. @end example
  410. @node More Package Commands
  411. @section More Package Commands
  412. And some more commands related to packages:
  413. @table @kbd
  414. @findex guix-number-of-packages
  415. @item M-x guix-number-of-packages
  416. This command just displays a message (in the minibuffer) with the
  417. number of available packages. Along with the default Guix packages,
  418. this number includes the packages from @code{GUIX_PACKAGE_PATH}
  419. environment variable (@pxref{Package Modules,,, guix, The GNU Guix
  420. Reference Manual}).
  421. @cindex graph
  422. @findex guix-package-graph
  423. @item M-x guix-package-graph
  424. Show a package graph. You'll be prompted for a package name, graph
  425. backend and graph node type (everything can be completed with
  426. @kbd{@key{TAB}} key). @xref{Graph Configuration}, if you want to set
  427. an external graph viewer.
  428. @findex guix-package-size
  429. @item M-x guix-package-size
  430. Show a package size (@pxref{Invoking guix size,,, guix, The GNU Guix
  431. Reference Manual}). You'll be prompted for a package name and a size
  432. type (it should be either ``text'' or ``image'').
  433. @findex guix-package-lint
  434. @item M-x guix-package-lint
  435. Lint a package (@pxref{Invoking guix lint,,, guix, The GNU Guix
  436. Reference Manual}). You'll be prompted for a package name. With
  437. prefix argument, you'll be also prompted for checker names.
  438. @end table
  439. @c ----------------------------------------------------------------
  440. @node Profiles and Generations
  441. @chapter Profiles and Generations
  442. As you know, packages are installed in @dfn{profiles}. The default
  443. user profile is @file{~/.guix-profile} (actually it is a symlink to
  444. the real profile) but you can also install packages to non-standard
  445. profiles (using @code{guix package --profile=@dots{}}).
  446. Profiles have @dfn{generations}. They appear whenever you perform any
  447. profile action (installing/removing packages). These generations are
  448. just symlinks to the previous versions of profile, so you can easily
  449. roll-back to any previous generation.
  450. As you may guess, Emacs-Guix provides an interface for profiles and
  451. their generations, where you can look at the packages from the old
  452. generations, switch to any generation, delete generations, etc.
  453. @menu
  454. * Profiles:: Interface for profiles.
  455. * Generations:: Interface for generations.
  456. @end menu
  457. @node Profiles
  458. @section Profiles
  459. @cindex profiles
  460. If you manage multiple Guix profiles, this section is for you.
  461. @kbd{M-x guix-profiles} is the entry point to display profiles. There
  462. you can look at the profile generations, installed packages and more.
  463. Read further for details.
  464. @menu
  465. * Profile Commands:: @kbd{M-x guix-profiles} and friends.
  466. * Profile Keys:: Key bindings in profile ``list'' buffer.
  467. @end menu
  468. @node Profile Commands
  469. @subsection Profile Commands
  470. @table @kbd
  471. @findex guix-profiles
  472. @vindex guix-profiles
  473. @item M-x guix-profiles
  474. Show a list of available Guix profiles. By default, it displays:
  475. @table @file
  476. @item ~/.guix-profile
  477. the default user profile
  478. @item ~/.config/guix/current
  479. profile, populated by @code{guix pull}
  480. @item /var/guix/profiles/system
  481. system profile (only on GuixSD)
  482. @item @env{GUIX_PROFILE}
  483. (only if this environment variable is set and this profile is not the
  484. same as one of the above)
  485. @end table
  486. If you use multiple profiles, you can add them to this list by setting
  487. @code{guix-profiles} variable, for example, like this:
  488. @example
  489. (with-eval-after-load 'guix-ui-profile
  490. (setq guix-profiles
  491. (append '("/path/to/my-profile1"
  492. "/path/to/my-profile2")
  493. guix-profiles)))
  494. @end example
  495. The ``profile-list'' buffer provides some keys to work with profiles
  496. (@pxref{Profile Keys}), but also there are the following standalone
  497. profile commands that can be called outside this buffer.
  498. @vindex guix-current-profile
  499. @findex guix-set-current-profile
  500. @item M-x guix-set-current-profile
  501. Set the current profile (@code{guix-current-profile} variable) to the
  502. specified one. The current profile is used by the package commands
  503. (@pxref{Package Commands}) to check what package is installed in this
  504. profile, and by generation commands (@pxref{Generation Commands}).
  505. @findex guix-apply-manifest
  506. @item M-x guix-apply-manifest
  507. Apply a manifest file to the current profile or a specified profile,
  508. if the prefix argument is used. This has the same meaning as
  509. @code{--manifest} option (@pxref{Invoking guix package,,, guix, The
  510. GNU Guix Reference Manual}).
  511. @end table
  512. @node Profile Keys
  513. @subsection Profile Keys
  514. Along with the general ``list'' keys (@pxref{List buffer}), a
  515. ``profile-list'' buffer (displayed by @kbd{M-x guix-profiles})
  516. additionally provides the following bindings:
  517. @table @kbd
  518. @item P
  519. Display packages installed in profile at point.
  520. @item G
  521. Display generations of profile at point.
  522. @item E
  523. Display ``search paths'' environment variables for the marked
  524. profiles, or the current profile if nothing is marked. This command
  525. is analogous to @code{guix package --search-paths} shell command
  526. (@pxref{Invoking guix package,,, guix, The GNU Guix Reference
  527. Manual}).
  528. @item c
  529. Make profile at point the current profile for the package commands
  530. (@pxref{Packages}).
  531. @item M
  532. Apply manifest from a specified file to the profile at point.
  533. @end table
  534. @node Generations
  535. @section Generations
  536. @cindex generations
  537. Each Guix profile may have multiple generations and Emacs-Guix allows
  538. you to display these generations, to switch to a particular
  539. generation, to look at the packages installed in it and to compare 2
  540. generations.
  541. @menu
  542. * Generation Commands:: @kbd{M-x guix-@dots{}} to show profile generations.
  543. * Generation Keys:: Key bindings in generation ``list'' buffer.
  544. @end menu
  545. @node Generation Commands
  546. @subsection Generation Commands
  547. As with commands for displaying packages (@pxref{Package Commands}),
  548. commands for displaying generations also use the current profile and
  549. can be called with a prefix argument.
  550. @table @kbd
  551. @findex guix-generations
  552. @item M-x guix-generations
  553. List all the generations.
  554. @findex guix-last-generations
  555. @item M-x guix-last-generations
  556. List the @var{N} last generations. You will be prompted for the number
  557. of generations.
  558. @findex guix-generations-by-time
  559. @item M-x guix-generations-by-time
  560. List generations matching time period. You will be prompted for the
  561. period using Org mode time prompt based on Emacs calendar (@pxref{The
  562. date/time prompt,,, org, The Org Manual}).
  563. @end table
  564. If you use GuixSD, you may also look at the system generations using
  565. the similar commands (@pxref{System Commands}).
  566. @node Generation Keys
  567. @subsection Generation Keys
  568. Along with the general ``list'' keys (@pxref{List buffer}), a
  569. ``generation-list'' buffer additionally provides the following
  570. bindings:
  571. @table @kbd
  572. @item P
  573. Display packages installed in the current generation.
  574. @item E
  575. Display ``search paths'' environment variables for the marked
  576. generations. This command is similar to the one for a list of
  577. profiles (@pxref{Profiles}).
  578. @item c
  579. Switch profile to the current generation.
  580. @item d
  581. Mark the current generation for deletion (with prefix, mark all
  582. generations).
  583. @item x
  584. Execute actions on the marked generations---i.e., delete generations.
  585. @item e
  586. Run Ediff (@pxref{Top,,, ediff, The Ediff Manual}) on package outputs
  587. installed in the 2 marked generations. With prefix argument, run Ediff
  588. on manifests of the marked generations.
  589. @item =
  590. Run Diff (@pxref{Diff Mode,,, emacs, The GNU Emacs Manual}) on package
  591. outputs installed in the 2 marked generations. With prefix argument,
  592. run Diff on manifests of the marked generations.
  593. @item +
  594. List package outputs added to the latest marked generation comparing
  595. with another marked generation.
  596. @item -
  597. List package outputs removed from the latest marked generation comparing
  598. with another marked generation.
  599. @end table
  600. @c ----------------------------------------------------------------
  601. @node System
  602. @chapter System
  603. This chapter describes Emacs-Guix features related to GuixSD, in
  604. particular:
  605. @itemize
  606. @item interface for system configuration file;
  607. @item interface for system services;
  608. @item commands to display system profile and generations.
  609. @end itemize
  610. @menu
  611. * System From File:: Interface for @code{operating-system} declaration.
  612. * Services:: Interface for system services.
  613. * System Commands:: Other @kbd{M-x guix-@dots{}} related to system.
  614. @end menu
  615. @node System From File
  616. @section System From File
  617. @cindex system
  618. Your system configuration file (for GuixSD) contains
  619. @code{operating-system} declaration (@pxref{operating-system
  620. Reference,,, guix, The GNU Guix Reference Manual}).
  621. And Emacs-Guix provides an interface for this @code{operating-system},
  622. where you can look at the packages, services, initrd modules that this
  623. system will install and some other stuff.
  624. @table @kbd
  625. @findex guix-system-from-file
  626. @item guix-system-from-file
  627. Find your system configuration file and look at the system it
  628. provides.
  629. @end table
  630. @node Services
  631. @section Services
  632. @cindex services
  633. If you use GuixSD, you may have a wish to become more familiar with
  634. the system services (@pxref{Services,,, guix, The GNU Guix Reference
  635. Manual}). Emacs-Guix provides several commands to display these
  636. services.
  637. @menu
  638. * Service Commands:: @kbd{M-x guix-@dots{}} to show services.
  639. * Service Locations:: Interface for locations of services.
  640. @end menu
  641. @node Service Commands
  642. @subsection Service Commands
  643. The interface for services is very similar to the interface for
  644. packages (@pxref{Packages}). The following commands allows you to
  645. look at the GuixSD services.
  646. @table @kbd
  647. @findex guix-all-services
  648. @item M-x guix-all-services
  649. Display all available services.
  650. @findex guix-default-services
  651. @item M-x guix-default-services
  652. Display services from @code{%base-services} (@pxref{Base Services,,,
  653. guix, The GNU Guix Reference Manual}) or @code{%desktop-services}
  654. (@pxref{Desktop Services,,, guix, The GNU Guix Reference Manual}).
  655. You will be prompted in the minibuffer for the variable name
  656. (completions available).
  657. @findex guix-services-by-name
  658. @item M-x guix-services-by-name
  659. Display service(s) with the specified name.
  660. @findex guix-services-by-regexp
  661. @vindex guix-service-search-params
  662. @item M-x guix-services-by-regexp
  663. Search for services by a specified regexp. By default, ``name'' and
  664. ``description'' of the services will be searched. This can be changed
  665. by modifying @code{guix-service-search-params} variable.
  666. @findex guix-services-by-location
  667. @item M-x guix-services-by-location
  668. Display service(s) located in the specified file.
  669. @findex guix-services-from-system-config-file
  670. @item M-x guix-services-from-system-config-file
  671. Display services from the specified file with @code{operating-system}
  672. declaration.
  673. @end table
  674. @node Service Locations
  675. @subsection Service Locations
  676. @cindex service Locations
  677. Similarly to the package locations (@pxref{Package Locations}), you
  678. may look at the service locations:
  679. @table @kbd
  680. @findex guix-service-locations
  681. @item M-x guix-service-locations
  682. Display a list of files with service locations. Press @kbd{@key{RET}}
  683. there to display services placed in the current location.
  684. @findex guix-find-service-location-file
  685. @item M-x guix-find-service-location-file
  686. Open a file with service definitions (press @kbd{@key{TAB}} to choose
  687. the file from a completion list).
  688. @findex guix-find-service-definition
  689. @item M-x guix-find-service-definition
  690. Go to the service location---i.e., open a file with the specified
  691. service and move the point to its definition.
  692. @end table
  693. @node System Commands
  694. @section System Commands
  695. Along with the commands for services and @code{operating-system},
  696. there are commands to look at the system profile
  697. (@file{/var/guix/profiles/system}), its generations and packages
  698. installed in it.
  699. @table @kbd
  700. @findex guix-system-profile
  701. @item M-x guix-system-profile
  702. Display ``info'' interface for the system profile.
  703. @findex guix-system-generations
  704. @item M-x guix-system-generations
  705. @findex guix-last-system-generations
  706. @itemx M-x guix-last-system-generations
  707. @findex guix-system-generations-by-time
  708. @itemx M-x guix-system-generations-by-time
  709. Display generations of the system profile. These commands have the
  710. same meaning as the usual generation commands (@pxref{Generation
  711. Commands}).
  712. @findex guix-installed-system-packages
  713. @item M-x guix-installed-system-packages
  714. Display packages installed in the system profile.
  715. @findex guix-packages-from-system-config-file
  716. @item M-x guix-packages-from-system-config-file
  717. @findex guix-services-from-system-config-file
  718. @item M-x guix-services-from-system-config-file
  719. Display packages/services from the specified system configuration
  720. file. You can also look at these packages/services from the
  721. ``system-info'' interface (@pxref{System From File}).
  722. @end table
  723. @c ----------------------------------------------------------------
  724. @node Package Licenses
  725. @chapter Package Licenses
  726. @cindex package licenses
  727. If you want to browse the URL of a particular license, or to look at a
  728. list of licenses, you may use the following commands:
  729. @table @kbd
  730. @findex guix-browse-license-url
  731. @item M-x guix-browse-license-url
  732. Choose a license from a completion list to browse its URL using
  733. @code{browse-url} function (@pxref{Browse-URL,,, emacs, The GNU Emacs
  734. Manual}).
  735. @findex guix-licenses
  736. @item M-x guix-licenses
  737. Display a list of available licenses. You can press @kbd{P} key
  738. there to display packages with this license in the same way as
  739. @kbd{M-x@tie{}guix-packages-by-license} would do (@pxref{Package
  740. Commands}).
  741. @findex guix-find-license-location-file
  742. @item M-x guix-find-license-location-file
  743. Open @file{@dots{}/guix/licenses.scm} file.
  744. @findex guix-find-license-definition
  745. @item M-x guix-find-license-definition
  746. Open @file{@dots{}/guix/licenses.scm} and move to the specified license.
  747. @end table
  748. @c ----------------------------------------------------------------
  749. @node Popup Interface
  750. @chapter Popup Interface
  751. If you ever used Magit, you know what ``popup interface'' is
  752. (@pxref{Top,,, magit-popup, Magit-Popup User Manual}). Even if you are
  753. not acquainted with Magit, there should be no worries as it is very
  754. intuitive.
  755. @findex guix
  756. So @kbd{M-x@tie{}guix} command provides a top-level popup interface
  757. for all available guix commands. When you select an option, you'll be
  758. prompted for a value in the minibuffer. Many values have completions,
  759. so don't hesitate to press @kbd{@key{TAB}} key. Multiple values (for
  760. example, packages or lint checkers) should be separated by commas.
  761. After specifying all options and switches for a command, you may choose
  762. one of the available actions. The following default actions are
  763. available for all commands:
  764. @itemize
  765. @item
  766. Run the command in the Guix REPL. It is faster than running
  767. @code{guix@tie{}@dots{}} command directly in shell, as there is no
  768. need to run another guile process and to load required modules there.
  769. @item
  770. @vindex guix-run-in-shell-function
  771. Run the command in a shell buffer. You can set
  772. @code{guix-run-in-shell-function} variable to fine tune the shell buffer
  773. you want to use.
  774. @item
  775. Add the command line to the kill ring (@pxref{Kill Ring,,, emacs, The
  776. GNU Emacs Manual}).
  777. @end itemize
  778. @cindex graph
  779. Several commands (@command{guix graph}, @command{guix system
  780. shepherd-graph} and @command{guix system extension-graph}) also have a
  781. ``View graph'' action, which allows you to view a generated graph
  782. (@pxref{Graph Configuration}).
  783. @c ----------------------------------------------------------------
  784. @node Prettify Mode
  785. @chapter Guix Prettify Mode
  786. Emacs-Guix also comes with ``guix-prettify.el''. It provides a minor
  787. mode for abbreviating store file names by replacing hash sequences of
  788. symbols with ``@dots{}'':
  789. @example
  790. /gnu/store/72f54nfp6g1hz873w8z3gfcah0h4nl9p-foo-0.1
  791. @result{} /gnu/store/…-foo-0.1
  792. @end example
  793. @table @kbd
  794. @findex guix-prettify-mode
  795. @item M-x guix-prettify-mode
  796. Enable/disable prettifying for the current buffer.
  797. @findex global-guix-prettify-mode
  798. @item M-x global-guix-prettify-mode
  799. Enable/disable prettifying globally.
  800. @end table
  801. If you wish to enable @code{global-guix-prettify-mode} automatically
  802. on Emacs start, you may do it by adding the following line to your
  803. Emacs init file:
  804. @example
  805. (add-hook 'after-init-hook 'global-guix-prettify-mode)
  806. @end example
  807. If you want to enable it only for specific major modes, add it to the
  808. mode hooks (@pxref{Hooks,,, emacs, The GNU Emacs Manual}), for example:
  809. @example
  810. (add-hook 'shell-mode-hook 'guix-prettify-mode)
  811. (add-hook 'dired-mode-hook 'guix-prettify-mode)
  812. @end example
  813. @c ----------------------------------------------------------------
  814. @node Prettify Variables
  815. @chapter Guix Environment Variables Mode
  816. Emacs-Guix provides a major mode based on @code{sh-mode} for
  817. prettifying @file{environment-variables} and @file{profile} files. It
  818. will split all exported variables and separate them with a newline.
  819. All @file{/tmp/guix-build-*-*.drv-*/environment-variables} and
  820. @file{/etc/profile} will be prettified by default.
  821. @vindex guix-env-var-enable-formatting
  822. If you want to disable this prettifying, set
  823. @code{guix-env-var-enable-formatting} variable to nil.
  824. You could also directly use @code{guix-env-var-prettify-buffer} to
  825. prettify the current buffer without changing its major mode and
  826. @code{guix-env-var-prettify-variable} to prettify a variable at
  827. current line.
  828. @table @kbd
  829. @findex guix-env-var-mode
  830. @item M-x guix-env-var-mode
  831. Enable/disable prettifying for the current buffer.
  832. @findex guix-env-var-prettify-buffer
  833. @item M-x guix-env-var-prettify-buffer
  834. Prettify current buffer without switching to @code{guix-env-var-mode}.
  835. @findex guix-env-var-prettify-variable
  836. @item M-x guix-env-var-prettify-variable
  837. Prettify variable assignment at current line.
  838. @end table
  839. @c ----------------------------------------------------------------
  840. @node Build Log Mode
  841. @chapter Build Log Mode
  842. @cindex build log
  843. @findex guix-build-log-mode
  844. Emacs-Guix provides major and minor modes for highlighting build logs.
  845. So when you have a file with a package build output---for example, a
  846. file returned by @command{guix build --log-file @dots{}} command
  847. (@pxref{Invoking guix build,,, guix, The GNU Guix Reference Manual}),
  848. you may call @kbd{M-x@tie{}guix-build-log-mode} command in the buffer
  849. with this file. This major mode highlights some lines specific to
  850. build output and provides the following key bindings:
  851. @table @kbd
  852. @item M-n
  853. Move to the next build phase.
  854. @item M-p
  855. Move to the previous build phase.
  856. @item @key{TAB}
  857. Toggle (show/hide) the body of the current build phase.
  858. @item S-@key{TAB}
  859. Toggle (show/hide) the bodies of all build phases.
  860. @end table
  861. @findex guix-build-log-minor-mode
  862. There is also @kbd{M-x@tie{}guix-build-log-minor-mode} which also
  863. provides the same highlighting and the same key bindings as the major
  864. mode, but prefixed with @kbd{C-c}. You may find this minor mode
  865. useful for shell buffers (@pxref{Interactive Shell,,, emacs, The GNU
  866. Emacs Manual}). It can be enabled there like this:
  867. @example
  868. (add-hook 'shell-mode-hook 'guix-build-log-minor-mode)
  869. @end example
  870. @c ----------------------------------------------------------------
  871. @node Completions
  872. @chapter Shell Completions
  873. @cindex shell
  874. @cindex completions
  875. Another available feature is completing @command{guix} subcommands,
  876. options, packages and other things in @code{shell} (@pxref{Interactive
  877. Shell,,, emacs, The GNU Emacs Manual}) and @code{eshell}
  878. (@pxref{Top,,, eshell, Eshell: The Emacs Shell}) buffers.
  879. It works the same way as other completions do. Just press
  880. @kbd{@key{TAB}} when your intuition tells you.
  881. And here are some examples, where pressing @kbd{@key{TAB}} may
  882. complete something:
  883. @itemize @w{}
  884. @item @code{guix pa}@kbd{@key{TAB}}
  885. @item @code{guix package -}@kbd{@key{TAB}}
  886. @item @code{guix package --}@kbd{@key{TAB}}
  887. @item @code{guix package -i gei}@kbd{@key{TAB}}
  888. @item @code{guix build -L/tm}@kbd{@key{TAB}}
  889. @item @code{guix build --sy}@kbd{@key{TAB}}
  890. @item @code{guix build --system=i}@kbd{@key{TAB}}
  891. @item @code{guix system rec}@kbd{@key{TAB}}
  892. @item @code{guix lint --checkers=sy}@kbd{@key{TAB}}
  893. @item @code{guix lint --checkers=synopsis,des}@kbd{@key{TAB}}
  894. @item @code{guix graph --backend=}@kbd{@key{TAB}}
  895. @end itemize
  896. @c ----------------------------------------------------------------
  897. @node Development
  898. @chapter Development
  899. @findex guix-devel-mode
  900. If you often work with Guix package files, you may want to see some
  901. highlighting and to have some indentation rules specific for Guix
  902. keywords. There is a minor mode to help
  903. you---@kbd{M-x@tie{}guix-devel-mode}. It can be enabled in Scheme
  904. buffers like this:
  905. @example
  906. (add-hook 'scheme-mode-hook 'guix-devel-mode)
  907. @end example
  908. Along with highlighting and indentation, this minor mode provides the
  909. following key bindings:
  910. @table @kbd
  911. @item C-c . k
  912. Copy the name of the current Guile module into kill ring
  913. (@code{guix-devel-copy-module-as-kill}).
  914. @item C-c . u
  915. Use the current Guile module. Often after opening a Scheme file, you
  916. want to use a module it defines, so you switch to the Geiser REPL and
  917. write @code{,use (some module)} there. You may just use this command
  918. instead (@code{guix-devel-use-module}).
  919. @item C-c . b
  920. Build a package defined by the current variable definition. The
  921. building process is run in the current Geiser REPL. If you modified the
  922. current package definition, don't forget to reevaluate it before calling
  923. this command---for example, with @kbd{C-M-x} (@pxref{To eval or not to
  924. eval,,, geiser, Geiser User Manual})
  925. (@code{guix-devel-build-package-definition}).
  926. @item C-c . s
  927. Build a source derivation of the package defined by the current
  928. variable definition. This command has the same meaning as @code{guix
  929. build -S} shell command (@pxref{Invoking guix build,,, guix, The GNU
  930. Guix Reference Manual}) (@code{guix-devel-build-package-source}).
  931. @item C-c . d
  932. Download a source of the package defined by the current variable
  933. definition. This command is the same as running @code{guix download}
  934. shell command on the package source (@pxref{Invoking guix download,,,
  935. guix, The GNU Guix Reference Manual})
  936. (@code{guix-devel-download-package-source}).
  937. @item C-c . l
  938. Lint (check) a package defined by the current variable definition
  939. (@pxref{Invoking guix lint,,, guix, The GNU Guix Reference Manual})
  940. (@code{guix-devel-lint-package}).
  941. @item C-c . '
  942. Edit @code{description} or @code{synopsis} of the current package in
  943. @code{texinfo-mode} (@code{guix-devel-code-block-edit}).
  944. @end table
  945. Unluckily, there is a limitation related to long-running REPL commands.
  946. When there is a running process in a Geiser REPL, you are not supposed
  947. to evaluate anything in a scheme buffer, because this will ``freeze''
  948. the REPL: it will stop producing any output (however, the evaluating
  949. process will continue---you will just not see any progress anymore). Be
  950. aware: even moving the point in a scheme buffer may ``break'' the REPL
  951. if Autodoc (@pxref{Autodoc and friends,,, geiser, Geiser User Manual})
  952. is enabled (which is the default).
  953. So you have to postpone editing your scheme buffers until the running
  954. evaluation will be finished in the REPL.
  955. Alternatively, to avoid this limitation, you may just run another Geiser
  956. REPL, and while something is being evaluated in the previous REPL, you
  957. can continue editing a scheme file with the help of the current one.
  958. @cindex ffap
  959. To find a patch file at point with @kbd{M-x ffap} command, you may use:
  960. @example
  961. (add-to-list 'ffap-alist '("\\.patch" . guix-devel-ffap-patch))
  962. @end example
  963. @c ----------------------------------------------------------------
  964. @node Hydra
  965. @chapter Hydra
  966. @cindex hydra
  967. The continuous integration server at @code{hydra.gnu.org} builds all
  968. the distribution packages on the supported architectures and serves
  969. them as substitutes (@pxref{Substitutes,,, guix, The GNU Guix
  970. Reference Manual}). Continuous integration is currently orchestrated
  971. by @uref{https://nixos.org/hydra/, Hydra}.
  972. This section describes an Emacs interface to query Hydra to know the
  973. build status of specific packages, discover recent and ongoing builds,
  974. view build logs, and so on. This interface is mostly the same as the
  975. ``list''/``info'' interface for displaying packages
  976. (@pxref{Packages}), generations (@pxref{Generations}) and other
  977. things.
  978. The following commands are available:
  979. @table @kbd
  980. @findex guix-hydra-latest-builds
  981. @vindex guix-hydra-number-of-builds
  982. @item M-x guix-hydra-latest-builds
  983. Display the latest failed or successful builds. With @kbd{C-u}, you
  984. will be prompted for the number of builds and other parameters
  985. (project, jobset, job and system). If you want to change the default
  986. number of builds, set @code{guix-hydra-number-of-builds} variable.
  987. @findex guix-hydra-queued-builds
  988. @item M-x guix-hydra-queued-builds
  989. Display scheduled or currently running builds.
  990. @findex guix-hydra-jobsets
  991. @item M-x guix-hydra-jobsets
  992. Display available jobsets (you will be prompted for a project).
  993. @end table
  994. In a list of builds you can press @kbd{L} key to display a build log of
  995. the current build. Also both a list of builds and a list of jobsets
  996. provide @kbd{B} key to display latest builds of the current job or
  997. jobset (don't forget about @kbd{C-u}).
  998. @c ----------------------------------------------------------------
  999. @node List/Info Interface
  1000. @chapter List/Info Interface
  1001. As you probably already know, there are multiple commands that display
  1002. various lists (of packages, licenses, etc.). This is so-called
  1003. ``list'' interface. Also you can get the same data displayed in
  1004. ``info'' interface. This chapter describes these interfaces.
  1005. @menu
  1006. * List/Info Keys:: Common keys for both interfaces.
  1007. * ``List'' buffer: List buffer. List-like interface.
  1008. * ``Info'' buffer: Info buffer. Help-like interface.
  1009. @end menu
  1010. @node List/Info Keys
  1011. @section List/Info Keys
  1012. The following keys are available for both ``list'' and ``info''
  1013. interfaces:
  1014. @table @kbd
  1015. @item h
  1016. Show ``hint'' (a message with available key bindings).
  1017. @item l
  1018. @itemx r
  1019. Go backward/forward by the history of the displayed results (this
  1020. history is similar to the history of the Emacs @code{help-mode} or
  1021. @code{Info-mode}).
  1022. @item g
  1023. Revert current buffer: update (receive it again) the currently
  1024. displayed data and redisplay it.
  1025. @item R
  1026. Redisplay current buffer (without updating the data).
  1027. @item ?
  1028. Describe current mode.
  1029. @end table
  1030. Also some buffers provide the following keys:
  1031. @table @kbd
  1032. @item M
  1033. Apply manifest file to the current profile (@pxref{Miscellaneous
  1034. Commands, @code{guix-apply-manifest}}).
  1035. @item C-c C-z
  1036. @cindex Guix REPL
  1037. Go to the Guix REPL (@pxref{The REPL,,, geiser, Geiser User Manual}).
  1038. @end table
  1039. @emph{Hint:} If you need several ``list'' or ``info'' buffers, you can
  1040. simply @kbd{M-x@tie{}clone-buffer} them, and each buffer will have its
  1041. own history.
  1042. @node List buffer
  1043. @section ``List'' buffer
  1044. An interface of a ``list'' buffer is similar to the interface provided
  1045. by ``package.el'' (@pxref{Package Menu,,, emacs, The GNU Emacs Manual}).
  1046. And here are the default key bindings (some of them may be rebound
  1047. to more specific commands):
  1048. @table @kbd
  1049. @item m
  1050. Mark the current entry (with prefix, mark all entries).
  1051. @item u
  1052. Unmark the current entry (with prefix, unmark all entries).
  1053. @item @key{DEL}
  1054. Unmark backward.
  1055. @item @key{RET}
  1056. @itemx i
  1057. Display ``info'' interface for the marked entries (or the current
  1058. entry if nothing is marked).
  1059. @item s
  1060. Sort entries by column specified by the prefix argument (counting from
  1061. 0).
  1062. @end table
  1063. @node Info buffer
  1064. @section ``Info'' buffer
  1065. The interface of an ``info'' buffer is similar to the interface of
  1066. @code{help-mode} (@pxref{Help Mode,,, emacs, The GNU Emacs Manual}),
  1067. or rather @code{Custom-mode} (@pxref{Easy Customization,,, emacs, The
  1068. GNU Emacs Manual}), as it is full of various buttons that can be used
  1069. to open files, browse URLs, do some actions (like installing/removing
  1070. packages), etc.
  1071. @cindex buttons
  1072. As always, you may use @kbd{@key{TAB}} / @kbd{S-@key{TAB}} to move
  1073. between buttons and @kbd{@key{RET}} to press a button, or you can just
  1074. use mouse (@pxref{Mouse References,,, emacs, The GNU Emacs Manual}).
  1075. Finally, you can copy any button label (a link to an URL or a file) by
  1076. pressing @kbd{c} on a button.
  1077. @c ----------------------------------------------------------------
  1078. @node Configuration
  1079. @chapter Configuration
  1080. @cindex customization group
  1081. There are many variables you can modify to change the appearance or
  1082. behavior of Emacs-Guix. Some of these variables are described in this
  1083. section. Also you can use Custom Interface (@pxref{Easy
  1084. Customization,,, emacs, The GNU Emacs Manual}) to explore/set
  1085. variables and faces---@kbd{M-x@tie{}customize-group @key{RET} guix}.
  1086. @menu
  1087. * Graph Configuration:: Set external viewer for graphs, etc.
  1088. * Guile and Build Options:: Settings for Guix REPL, Guile, etc.
  1089. * List/Info Configuration:: Variables for various interfaces.
  1090. * Buffer Names:: Names of Guix buffers.
  1091. * Keymaps:: Configuring key bindings.
  1092. * Miscellaneous Configuration:: Other configuration variables.
  1093. @end menu
  1094. @node Graph Configuration
  1095. @section Graph Configuration
  1096. @cindex graph
  1097. Some commands may display a graph image. Currently Guix provides 2
  1098. graph backends (@pxref{Invoking guix graph,,, guix, The GNU Guix
  1099. Reference Manual}):
  1100. @table @code
  1101. @item d3js
  1102. Such graph will be displayed in your browser using @code{browse-url}
  1103. function (@pxref{Browse-URL,,, emacs, The GNU Emacs Manual}).
  1104. @item graphviz
  1105. Such graph will be displayed inside Emacs by default, but this can be
  1106. configured @dots{}
  1107. @end table
  1108. @vindex guix-find-file-function
  1109. @dots{} Graphs are opened using @code{guix-find-file-function}, so if
  1110. you want to use an external viewer, you need to set this variable.
  1111. Probably the easiest way to set an external viewer is to use a
  1112. functionality provided by the Org Mode. For example, if you want to
  1113. open the generated graphs (PNG files) with @code{sxiv} image viewer,
  1114. you can do it like this:
  1115. @example
  1116. (setq guix-find-file-function 'org-open-file)
  1117. (add-to-list 'org-file-apps '("\\.png\\'" . "sxiv %s"))
  1118. @end example
  1119. Now some deeper details and configuration options.
  1120. @vindex guix-dot-program
  1121. @vindex guix-dot-default-arguments
  1122. @vindex guix-dot-file-name-function
  1123. The @code{graphviz} graph is converted into an image file using
  1124. @command{dot} command specified by @code{guix-dot-program} and
  1125. @code{guix-dot-default-arguments} variables. By default, a PNG file is
  1126. generated and saved as @file{/tmp/emacs-guix-XXXXXX/graph-XXXXXX.png}.
  1127. If you want to change an output format (for example, into PDF), you also
  1128. need to change @code{guix-dot-file-name-function} (to make @code{.pdf}
  1129. extension of the output file). This can be done like this:
  1130. @example
  1131. (defun my-guix-pdf-graph ()
  1132. "/tmp/my-current-guix-graph.pdf")
  1133. (setq guix-dot-default-arguments '("-Tpdf")
  1134. guix-dot-file-name-function 'my-guix-pdf-graph)
  1135. @end example
  1136. @node Guile and Build Options
  1137. @section Guile and Build Options
  1138. @table @code
  1139. @vindex guix-guile-program
  1140. @item guix-guile-program
  1141. If you have some special needs for starting a Guile process, you may
  1142. set this variable. For example, by default, Guile is started with
  1143. @code{--no-auto-compile} flag (because auto-compilation may take a
  1144. very long time), so if you just want @code{guile} without any flags,
  1145. you may just use:
  1146. @example
  1147. (setq guix-guile-program "guile")
  1148. @end example
  1149. @vindex guix-load-path
  1150. @vindex guix-load-compiled-path
  1151. @item guix-load-path
  1152. @itemx guix-load-compiled-path
  1153. Directory or a list of directories prepended to Guile's
  1154. @code{%load-path} and @code{%load-compiled-path} (@pxref{Load Paths,,,
  1155. guile, The GNU Guile Reference Manual}).
  1156. If you use Guix from a git checkout (@pxref{Running Guix Before It Is
  1157. Installed,,, guix, The GNU Guix Reference Manual}), you may want
  1158. Emacs-Guix to use the same guix from git. All you need is to point
  1159. Emacs-Guix to this checkout:
  1160. @example
  1161. (setq guix-load-path "/path/to/guix-git-dir")
  1162. @end example
  1163. Note that setting @code{guix-load-compiled-path} is not needed when
  1164. Scheme (@code{.scm}) and compiled (@code{.go}) files are placed in the
  1165. same directories.
  1166. @vindex guix-use-substitutes
  1167. @item guix-use-substitutes
  1168. Has the same meaning as @code{--no-substitutes} option
  1169. (@pxref{Invoking guix build,,, guix, The GNU Guix Reference
  1170. Manual})---i.e., when non-nil, substitutes are enabled.
  1171. @vindex guix-dry-run
  1172. @item guix-dry-run
  1173. Has the same meaning as @code{--dry-run} option (@pxref{Invoking guix
  1174. build,,, guix, The GNU Guix Reference Manual})---i.e., when non-nil,
  1175. do not build the derivations.
  1176. @cindex Guix REPL
  1177. @vindex guix-repl-use-server
  1178. @item guix-repl-use-server
  1179. By default, along with the main Guix REPL, an additional (internal)
  1180. REPL is started. This allows you to display packages, generations and
  1181. to receive other info from the Scheme side, while there is some active
  1182. process in the main Guix REPL (e.g., while downloading or building
  1183. packages). If you don't want to have the second REPL, set this
  1184. variable to nil.
  1185. @vindex guix-repl-use-latest
  1186. @item guix-repl-use-latest
  1187. Set this variable to nil, if you don't want to use the latest Guix
  1188. code received with @code{guix pull} command (@pxref{Invoking guix
  1189. pull,,, guix, The GNU Guix Reference Manual}).
  1190. @end table
  1191. @node List/Info Configuration
  1192. @section List/Info Configuration
  1193. If you wish to change the appearance of various ``list'' and ``info''
  1194. buffers (@pxref{List/Info Interface}), you may look at
  1195. @code{guix-ENTRY-TYPE-BUFFER-TYPE-@dots{}} variables. Here,
  1196. @dfn{BUFFER-TYPE} is either @code{list} or @code{info}, and
  1197. @dfn{ENTRY-TYPE} is one of the following:
  1198. @table @code
  1199. @item package
  1200. @item package-location
  1201. @item output
  1202. @item profile
  1203. @item generation
  1204. @item system
  1205. @item system-generation
  1206. @item service
  1207. @item service-location
  1208. @item license
  1209. @item hydra-build
  1210. @item hydra-jobset
  1211. @end table
  1212. @vindex guix-ENTRY-TYPE-BUFFER-TYPE-format
  1213. The main variable of them is
  1214. @code{guix-ENTRY-TYPE-BUFFER-TYPE-format}: it defines what parameters,
  1215. in what order and in what way are displayed. You are welcome to play
  1216. with these ``format'' variables and to explore the other ones.
  1217. @node Buffer Names
  1218. @section Buffer Names
  1219. Default names of various Emacs-Guix buffers (``*Guix@tie{}@dots{}*'')
  1220. may be changed with the following variables:
  1221. @table @code
  1222. @vindex guix-ENTRY-TYPE-BUFFER-TYPE-buffer-name
  1223. @item guix-ENTRY-TYPE-BUFFER-TYPE-buffer-name
  1224. @xref{List/Info Configuration}, for the meaning of @code{ENTRY-TYPE}
  1225. and @code{BUFFER-TYPE}.
  1226. @vindex guix-ui-buffer-name-function
  1227. @item guix-ui-buffer-name-function
  1228. By default, many Guix buffers contain profile name (e.g., @code{*Guix
  1229. Packages: <profile>*}). This variable allows you to control how this
  1230. profile name is displayed. If you want to remove profile name from
  1231. the buffer names, you can do it like this:
  1232. @example
  1233. (setq guix-ui-buffer-name-function 'guix-ui-buffer-name-simple)
  1234. @end example
  1235. @vindex guix-repl-buffer-name
  1236. @item guix-repl-buffer-name
  1237. @vindex guix-internal-repl-buffer-name
  1238. @item guix-internal-repl-buffer-name
  1239. @vindex guix-search-paths-buffer-name
  1240. @item guix-search-paths-buffer-name
  1241. @vindex guix-help-buffer-name
  1242. @item guix-help-buffer-name
  1243. @vindex guix-about-buffer-name
  1244. @item guix-about-buffer-name
  1245. @end table
  1246. @node Keymaps
  1247. @section Keymaps
  1248. If you want to change default key bindings, look at the following
  1249. keymaps (@pxref{Init Rebinding,,, emacs, The GNU Emacs Manual}):
  1250. @table @code
  1251. @vindex guix-ui-map
  1252. @item guix-ui-map
  1253. Parent keymap with general keys for buffers used for Guix package
  1254. management.
  1255. @vindex guix-ENTRY-TYPE-BUFFER-TYPE-mode-map
  1256. @item guix-ENTRY-TYPE-BUFFER-TYPE-mode-map
  1257. @xref{List/Info Configuration}, for the meaning of @code{ENTRY-TYPE}
  1258. and @code{BUFFER-TYPE}.
  1259. @vindex guix-build-log-common-map
  1260. @item guix-build-log-common-map
  1261. @vindex guix-build-log-mode-map
  1262. @item guix-build-log-mode-map
  1263. @vindex guix-build-log-minor-mode-map
  1264. @item guix-build-log-minor-mode-map
  1265. @vindex guix-devel-keys-map
  1266. @item guix-devel-keys-map
  1267. @vindex guix-devel-mode-map
  1268. @item guix-devel-mode-map
  1269. @end table
  1270. @node Miscellaneous Configuration
  1271. @section Miscellaneous Configuration
  1272. @table @code
  1273. @vindex guix-support-dired
  1274. @item guix-support-dired
  1275. Some Emacs-Guix commands (for example, @kbd{M-x guix-hash} or @kbd{M-x
  1276. guix-package-from-file}) may or may not support @code{dired-mode}
  1277. (@pxref{Dired,,, emacs, The GNU Emacs Manual}). By default, whenever
  1278. you run them in a Dired buffer, they will use the file name at
  1279. point---i.e., you will not be prompted for it. If you wish to disable
  1280. this feature, set @code{guix-support-dired} variable to nil.
  1281. @end table
  1282. @c ----------------------------------------------------------------
  1283. @node Miscellaneous Commands
  1284. @chapter Miscellaneous Commands
  1285. And some more commands that were not covered by the other chapters.
  1286. @table @kbd
  1287. @findex guix-report-bug
  1288. @item M-x guix-report-bug
  1289. Open a mail buffer to report a bug for GNU Guix similarly to
  1290. @kbd{M-x@tie{}report-emacs-bug} command.
  1291. @findex guix-pull
  1292. @item M-x guix-pull
  1293. It is the same as @command{guix pull} shell command (@pxref{Invoking
  1294. guix pull,,, guix, The GNU Guix Reference Manual}). With @kbd{C-u},
  1295. make it verbose.
  1296. @cindex Guix REPL
  1297. Once @command{guix pull} has succeeded, the Guix REPL is
  1298. restarted@footnote{Note that name/version pairs cannot be used to
  1299. identify packages (because a name is not necessarily unique), so
  1300. Emacs-Guix uses special identifiers that live only during a guile
  1301. session, so if the Guix REPL was restarted, you may want to revert
  1302. ``list'' buffer (by pressing @kbd{g}).}. This allows you to keep
  1303. using the Emacs interface with the updated Guix code.
  1304. @findex guix-hash
  1305. @item M-x guix-hash
  1306. Compute and copy to the kill ring (@pxref{Yanking,,, emacs, The GNU
  1307. Emacs Manual}) the SHA256 hash of a file (@pxref{Invoking guix hash,,,
  1308. guix, The GNU Guix Reference Manual}). With @kbd{C-u}, prompt for a
  1309. hash format.
  1310. If you call this command on a directory, its hash will be calculated
  1311. recursively without version-controlled files (so you can use this hash
  1312. in a package recipe).
  1313. @end table
  1314. @c ----------------------------------------------------------------
  1315. @node Help
  1316. @chapter Help
  1317. So many commands, so many buffers! This chapter describes few more
  1318. commands that should help you not to get lost.
  1319. @table @kbd
  1320. @findex guix-help
  1321. @item M-x guix-help
  1322. Display a buffer with the summary of the available Emacs-Guix
  1323. commands. Buttons in this buffer allow you to run commands and to
  1324. look at their docstrings and manual entries.
  1325. @findex guix-info
  1326. @item M-x guix-info
  1327. Show this Emacs-Guix info manual. With prefix argument, show the Guix
  1328. info manual.
  1329. @findex guix-switch-to-buffer
  1330. @item M-x guix-switch-to-buffer
  1331. Switch to one of the Emacs-Guix buffers. This is like a usual
  1332. @code{switch-to-buffer} (bound to @kbd{C-x b} by default), except it
  1333. completes only Guix buffers names. If you are going to use this
  1334. command, it is probably better to bind it to some key, for example:
  1335. @example
  1336. (global-set-key (kbd "C-x B") 'guix-switch-to-buffer)
  1337. @end example
  1338. @findex guix-extended-command
  1339. @item M-x guix-extended-command
  1340. Run Emacs-Guix command. This is like @kbd{M-x} (@pxref{M-x,,, emacs,
  1341. The GNU Emacs Manual}), except it completes only Guix command names.
  1342. And again, this is not a very useful command unless it is bound to
  1343. some key, for example:
  1344. @example
  1345. (global-set-key (kbd "M-X") 'guix-extended-command)
  1346. @end example
  1347. @end table
  1348. @c ----------------------------------------------------------------
  1349. @node Concept Index
  1350. @unnumbered Concept Index
  1351. @printindex cp
  1352. @node Command Index
  1353. @unnumbered Command Index
  1354. @printindex fn
  1355. @node Variable Index
  1356. @unnumbered Variable Index
  1357. @printindex vr
  1358. @bye