Skip to content
Snippets Groups Projects
guix.texi 627 KiB
Newer Older
  • Learn to ignore specific revisions
  • 
    Usually the X server is started by a login manager.
    @end deffn
    
    
    @deffn {Scheme Procedure} xorg-configuration-file @
    
      [#:drivers '()] [#:resolutions '()] [#:extra-config '()]
    
    Return a configuration file for the Xorg server containing search paths for
    all the common drivers.
    
    
    @var{drivers} must be either the empty list, in which case Xorg chooses a
    graphics driver automatically, or a list of driver names that will be tried in
    
    this order---e.g., @code{(\"modesetting\" \"vesa\")}.
    
    
    Likewise, when @var{resolutions} is the empty list, Xorg chooses an
    appropriate screen resolution; otherwise, it must be a list of
    resolutions---e.g., @code{((1024 768) (640 480))}.
    
    
    Last, @var{extra-config} is a list of strings or objects appended to the
    @code{text-file*} argument list.  It is used to pass extra text to be added
    verbatim to the configuration file.
    
    @deffn {Scheme Procedure} screen-locker-service @var{package} [@var{name}]
    Add @var{package}, a package for a screen-locker or screen-saver whose
    command is @var{program}, to the set of setuid programs and add a PAM entry
    for it.  For example:
    
    @lisp
    (screen-locker-service xlockmore "xlock")
    @end lisp
    
    makes the good ol' XlockMore usable.
    @end deffn
    
    
    
    Andy Wingo's avatar
    Andy Wingo committed
    @node Printing Services
    @subsubsection Printing Services
    
    
    @cindex printer support with CUPS
    
    Andy Wingo's avatar
    Andy Wingo committed
    The @code{(gnu services cups)} module provides a Guix service definition
    for the CUPS printing service.  To add printer support to a GuixSD
    system, add a @code{cups-service} to the operating system definition:
    
    @deffn {Scheme Variable} cups-service-type
    The service type for the CUPS print server.  Its value should be a valid
    
    CUPS configuration (see below).  To use the default settings, simply
    write:
    
    Andy Wingo's avatar
    Andy Wingo committed
    @example
    
    Andy Wingo's avatar
    Andy Wingo committed
    @end example
    @end deffn
    
    The CUPS configuration controls the basic things about your CUPS
    installation: what interfaces it listens on, what to do if a print job
    fails, how much logging to do, and so on.  To actually add a printer,
    you have to visit the @url{http://localhost:631} URL, or use a tool such
    as GNOME's printer configuration services.  By default, configuring a
    CUPS service will generate a self-signed certificate if needed, for
    secure connections to the print server.
    
    
    Suppose you want to enable the Web interface of CUPS and also add
    support for HP printers @i{via} the @code{hplip} package.  You can do
    that directly, like this (you need to use the @code{(gnu packages cups)}
    module):
    
    Andy Wingo's avatar
    Andy Wingo committed
    
    @example
    (service cups-service-type
             (cups-configuration
    
               (web-interface? #t)
               (extensions
                 (list cups-filters hplip))))
    
    Andy Wingo's avatar
    Andy Wingo committed
    10072 10073 10074 10075 10076 10077 10078 10079 10080 10081 10082 10083 10084 10085 10086 10087 10088 10089 10090 10091 10092 10093 10094 10095 10096 10097 10098 10099 10100 10101 10102 10103 10104 10105 10106 10107 10108 10109 10110 10111 10112 10113 10114 10115 10116 10117 10118 10119 10120 10121 10122 10123 10124 10125 10126 10127 10128 10129 10130 10131 10132 10133 10134 10135 10136 10137 10138 10139 10140 10141 10142 10143 10144 10145 10146 10147 10148 10149 10150 10151 10152 10153 10154 10155 10156 10157 10158 10159 10160 10161 10162 10163 10164 10165 10166 10167 10168 10169 10170 10171 10172 10173 10174 10175 10176 10177 10178 10179 10180 10181 10182 10183 10184 10185 10186 10187 10188 10189 10190 10191 10192 10193 10194 10195 10196 10197 10198 10199 10200 10201 10202 10203 10204 10205 10206 10207 10208 10209 10210 10211 10212 10213 10214 10215 10216 10217 10218 10219 10220 10221 10222 10223 10224 10225 10226 10227 10228 10229 10230 10231 10232 10233 10234 10235 10236 10237 10238 10239 10240 10241 10242 10243 10244 10245 10246 10247 10248 10249 10250 10251 10252 10253 10254 10255 10256 10257 10258 10259 10260 10261 10262 10263 10264 10265 10266 10267 10268 10269 10270 10271 10272 10273 10274 10275 10276 10277 10278 10279 10280 10281 10282 10283 10284 10285 10286 10287 10288 10289 10290 10291 10292 10293 10294 10295 10296 10297 10298 10299 10300 10301 10302 10303 10304 10305 10306 10307 10308 10309 10310 10311 10312 10313 10314 10315 10316 10317 10318 10319 10320 10321 10322 10323 10324 10325 10326 10327 10328 10329 10330 10331 10332 10333 10334 10335 10336 10337 10338 10339 10340 10341 10342 10343 10344 10345 10346 10347 10348 10349 10350 10351 10352 10353 10354 10355 10356 10357 10358 10359 10360 10361 10362 10363 10364 10365 10366 10367 10368 10369 10370 10371 10372 10373 10374 10375 10376 10377 10378 10379 10380 10381 10382 10383 10384 10385 10386 10387 10388 10389 10390 10391 10392 10393 10394 10395 10396 10397 10398 10399 10400 10401 10402 10403 10404 10405 10406 10407 10408 10409 10410 10411 10412 10413 10414 10415 10416 10417 10418 10419 10420 10421 10422 10423 10424 10425 10426 10427 10428 10429 10430 10431 10432 10433 10434 10435 10436 10437 10438 10439 10440 10441 10442 10443 10444 10445 10446 10447 10448 10449 10450 10451 10452 10453 10454 10455 10456 10457 10458 10459 10460 10461 10462 10463 10464 10465 10466 10467 10468 10469 10470 10471 10472 10473 10474 10475 10476 10477 10478 10479 10480 10481 10482 10483 10484 10485 10486 10487 10488 10489 10490 10491 10492 10493 10494 10495 10496 10497 10498 10499 10500 10501 10502 10503 10504 10505 10506 10507 10508 10509 10510 10511 10512 10513 10514 10515 10516 10517 10518 10519 10520 10521 10522 10523 10524 10525 10526 10527 10528 10529 10530 10531 10532 10533 10534 10535 10536 10537 10538 10539 10540 10541 10542 10543 10544 10545 10546 10547 10548 10549 10550 10551 10552 10553 10554 10555 10556 10557 10558 10559 10560 10561 10562 10563 10564 10565 10566 10567 10568 10569 10570 10571 10572 10573 10574 10575 10576 10577 10578 10579 10580 10581 10582 10583 10584 10585 10586 10587 10588 10589 10590 10591 10592 10593 10594 10595 10596 10597 10598 10599 10600 10601 10602 10603 10604 10605 10606 10607 10608 10609 10610 10611 10612 10613 10614 10615 10616 10617 10618 10619 10620 10621 10622 10623 10624 10625 10626 10627 10628 10629 10630 10631 10632 10633 10634 10635 10636 10637 10638 10639 10640 10641 10642 10643 10644 10645 10646 10647 10648 10649 10650 10651 10652 10653 10654 10655 10656 10657 10658 10659 10660 10661 10662 10663 10664 10665 10666 10667 10668 10669 10670 10671 10672 10673 10674 10675 10676 10677 10678 10679 10680 10681 10682 10683 10684 10685 10686 10687 10688 10689 10690 10691 10692 10693 10694 10695 10696 10697 10698 10699 10700 10701 10702 10703 10704 10705 10706 10707 10708 10709 10710 10711 10712 10713 10714 10715 10716 10717 10718 10719 10720 10721 10722 10723 10724 10725 10726 10727 10728 10729 10730 10731 10732 10733 10734 10735 10736 10737 10738 10739 10740 10741 10742 10743 10744 10745 10746 10747 10748 10749 10750 10751 10752 10753 10754 10755 10756 10757 10758 10759 10760 10761 10762 10763 10764 10765 10766 10767 10768 10769 10770 10771 10772 10773 10774 10775 10776 10777 10778 10779 10780 10781 10782 10783 10784 10785 10786 10787 10788 10789 10790 10791 10792 10793 10794 10795 10796 10797 10798 10799 10800 10801 10802 10803 10804 10805 10806 10807 10808 10809 10810 10811 10812 10813 10814 10815 10816 10817 10818 10819 10820 10821 10822 10823 10824 10825 10826 10827 10828 10829 10830 10831 10832 10833 10834 10835 10836 10837 10838 10839 10840 10841 10842 10843 10844 10845 10846 10847 10848 10849 10850 10851 10852 10853 10854 10855 10856 10857 10858 10859 10860 10861 10862 10863 10864 10865 10866 10867 10868 10869 10870 10871 10872
    @end example
    
    The available configuration parameters follow.  Each parameter
    definition is preceded by its type; for example, @samp{string-list foo}
    indicates that the @code{foo} parameter should be specified as a list of
    strings.  There is also a way to specify the configuration as a string,
    if you have an old @code{cupsd.conf} file that you want to port over
    from some other system; see the end for more details.
    
    @c The following documentation was initially generated by
    @c (generate-documentation) in (gnu services cups).  Manually maintained
    @c documentation is better, so we shouldn't hesitate to edit below as
    @c needed.  However if the change you want to make to this documentation
    @c can be done in an automated way, it's probably easier to change
    @c (generate-documentation) than to make it below and have to deal with
    @c the churn as CUPS updates.
    
    
    Available @code{cups-configuration} fields are:
    
    @deftypevr {@code{cups-configuration} parameter} package cups
    The CUPS package.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} package-list extensions
    Drivers and other extensions to the CUPS package.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} files-configuration files-configuration
    Configuration of where to write logs, what directories to use for print
    spools, and related privileged configuration parameters.
    
    Available @code{files-configuration} fields are:
    
    @deftypevr {@code{files-configuration} parameter} log-location access-log
    Defines the access log filename.  Specifying a blank filename disables
    access log generation.  The value @code{stderr} causes log entries to be
    sent to the standard error file when the scheduler is running in the
    foreground, or to the system log daemon when run in the background.  The
    value @code{syslog} causes log entries to be sent to the system log
    daemon.  The server name may be included in filenames using the string
    @code{%s}, as in @code{/var/log/cups/%s-access_log}.
    
    Defaults to @samp{"/var/log/cups/access_log"}.
    @end deftypevr
    
    @deftypevr {@code{files-configuration} parameter} file-name cache-dir
    Where CUPS should cache data.
    
    Defaults to @samp{"/var/cache/cups"}.
    @end deftypevr
    
    @deftypevr {@code{files-configuration} parameter} string config-file-perm
    Specifies the permissions for all configuration files that the scheduler
    writes.
    
    Note that the permissions for the printers.conf file are currently
    masked to only allow access from the scheduler user (typically root).
    This is done because printer device URIs sometimes contain sensitive
    authentication information that should not be generally known on the
    system.  There is no way to disable this security feature.
    
    Defaults to @samp{"0640"}.
    @end deftypevr
    
    @deftypevr {@code{files-configuration} parameter} log-location error-log
    Defines the error log filename.  Specifying a blank filename disables
    access log generation.  The value @code{stderr} causes log entries to be
    sent to the standard error file when the scheduler is running in the
    foreground, or to the system log daemon when run in the background.  The
    value @code{syslog} causes log entries to be sent to the system log
    daemon.  The server name may be included in filenames using the string
    @code{%s}, as in @code{/var/log/cups/%s-error_log}.
    
    Defaults to @samp{"/var/log/cups/error_log"}.
    @end deftypevr
    
    @deftypevr {@code{files-configuration} parameter} string fatal-errors
    Specifies which errors are fatal, causing the scheduler to exit.  The
    kind strings are:
    
    @table @code
    @item none
    No errors are fatal.
    
    @item all
    All of the errors below are fatal.
    
    @item browse
    Browsing initialization errors are fatal, for example failed connections
    to the DNS-SD daemon.
    
    @item config
    Configuration file syntax errors are fatal.
    
    @item listen
    Listen or Port errors are fatal, except for IPv6 failures on the
    loopback or @code{any} addresses.
    
    @item log
    Log file creation or write errors are fatal.
    
    @item permissions
    Bad startup file permissions are fatal, for example shared TLS
    certificate and key files with world-read permissions.
    @end table
    
    Defaults to @samp{"all -browse"}.
    @end deftypevr
    
    @deftypevr {@code{files-configuration} parameter} boolean file-device?
    Specifies whether the file pseudo-device can be used for new printer
    queues.  The URI @uref{file:///dev/null} is always allowed.
    
    Defaults to @samp{#f}.
    @end deftypevr
    
    @deftypevr {@code{files-configuration} parameter} string group
    Specifies the group name or ID that will be used when executing external
    programs.
    
    Defaults to @samp{"lp"}.
    @end deftypevr
    
    @deftypevr {@code{files-configuration} parameter} string log-file-perm
    Specifies the permissions for all log files that the scheduler writes.
    
    Defaults to @samp{"0644"}.
    @end deftypevr
    
    @deftypevr {@code{files-configuration} parameter} log-location page-log
    Defines the page log filename.  Specifying a blank filename disables
    access log generation.  The value @code{stderr} causes log entries to be
    sent to the standard error file when the scheduler is running in the
    foreground, or to the system log daemon when run in the background.  The
    value @code{syslog} causes log entries to be sent to the system log
    daemon.  The server name may be included in filenames using the string
    @code{%s}, as in @code{/var/log/cups/%s-page_log}.
    
    Defaults to @samp{"/var/log/cups/page_log"}.
    @end deftypevr
    
    @deftypevr {@code{files-configuration} parameter} string remote-root
    Specifies the username that is associated with unauthenticated accesses
    by clients claiming to be the root user.  The default is @code{remroot}.
    
    Defaults to @samp{"remroot"}.
    @end deftypevr
    
    @deftypevr {@code{files-configuration} parameter} file-name request-root
    Specifies the directory that contains print jobs and other HTTP request
    data.
    
    Defaults to @samp{"/var/spool/cups"}.
    @end deftypevr
    
    @deftypevr {@code{files-configuration} parameter} sandboxing sandboxing
    Specifies the level of security sandboxing that is applied to print
    filters, backends, and other child processes of the scheduler; either
    @code{relaxed} or @code{strict}.  This directive is currently only
    used/supported on macOS.
    
    Defaults to @samp{strict}.
    @end deftypevr
    
    @deftypevr {@code{files-configuration} parameter} file-name server-keychain
    Specifies the location of TLS certificates and private keys.  CUPS will
    look for public and private keys in this directory: a @code{.crt} files
    for PEM-encoded certificates and corresponding @code{.key} files for
    PEM-encoded private keys.
    
    Defaults to @samp{"/etc/cups/ssl"}.
    @end deftypevr
    
    @deftypevr {@code{files-configuration} parameter} file-name server-root
    Specifies the directory containing the server configuration files.
    
    Defaults to @samp{"/etc/cups"}.
    @end deftypevr
    
    @deftypevr {@code{files-configuration} parameter} boolean sync-on-close?
    Specifies whether the scheduler calls fsync(2) after writing
    configuration or state files.
    
    Defaults to @samp{#f}.
    @end deftypevr
    
    @deftypevr {@code{files-configuration} parameter} space-separated-string-list system-group
    Specifies the group(s) to use for @code{@@SYSTEM} group authentication.
    @end deftypevr
    
    @deftypevr {@code{files-configuration} parameter} file-name temp-dir
    Specifies the directory where temporary files are stored.
    
    Defaults to @samp{"/var/spool/cups/tmp"}.
    @end deftypevr
    
    @deftypevr {@code{files-configuration} parameter} string user
    Specifies the user name or ID that is used when running external
    programs.
    
    Defaults to @samp{"lp"}.
    @end deftypevr
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} access-log-level access-log-level
    Specifies the logging level for the AccessLog file.  The @code{config}
    level logs when printers and classes are added, deleted, or modified and
    when configuration files are accessed or updated.  The @code{actions}
    level logs when print jobs are submitted, held, released, modified, or
    canceled, and any of the conditions for @code{config}.  The @code{all}
    level logs all requests.
    
    Defaults to @samp{actions}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} boolean auto-purge-jobs?
    Specifies whether to purge job history data automatically when it is no
    longer required for quotas.
    
    Defaults to @samp{#f}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} browse-local-protocols browse-local-protocols
    Specifies which protocols to use for local printer sharing.
    
    Defaults to @samp{dnssd}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} boolean browse-web-if?
    Specifies whether the CUPS web interface is advertised.
    
    Defaults to @samp{#f}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} boolean browsing?
    Specifies whether shared printers are advertised.
    
    Defaults to @samp{#f}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} string classification
    Specifies the security classification of the server.  Any valid banner
    name can be used, including "classified", "confidential", "secret",
    "topsecret", and "unclassified", or the banner can be omitted to disable
    secure printing functions.
    
    Defaults to @samp{""}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} boolean classify-override?
    Specifies whether users may override the classification (cover page) of
    individual print jobs using the @code{job-sheets} option.
    
    Defaults to @samp{#f}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} default-auth-type default-auth-type
    Specifies the default type of authentication to use.
    
    Defaults to @samp{Basic}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} default-encryption default-encryption
    Specifies whether encryption will be used for authenticated requests.
    
    Defaults to @samp{Required}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} string default-language
    Specifies the default language to use for text and web content.
    
    Defaults to @samp{"en"}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} string default-paper-size
    Specifies the default paper size for new print queues.  @samp{"Auto"}
    uses a locale-specific default, while @samp{"None"} specifies there is
    no default paper size.  Specific size names are typically
    @samp{"Letter"} or @samp{"A4"}.
    
    Defaults to @samp{"Auto"}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} string default-policy
    Specifies the default access policy to use.
    
    Defaults to @samp{"default"}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} boolean default-shared?
    Specifies whether local printers are shared by default.
    
    Defaults to @samp{#t}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} non-negative-integer dirty-clean-interval
    Specifies the delay for updating of configuration and state files, in
    seconds.  A value of 0 causes the update to happen as soon as possible,
    typically within a few milliseconds.
    
    Defaults to @samp{30}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} error-policy error-policy
    Specifies what to do when an error occurs.  Possible values are
    @code{abort-job}, which will discard the failed print job;
    @code{retry-job}, which will retry the job at a later time;
    @code{retry-this-job}, which retries the failed job immediately; and
    @code{stop-printer}, which stops the printer.
    
    Defaults to @samp{stop-printer}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} non-negative-integer filter-limit
    Specifies the maximum cost of filters that are run concurrently, which
    can be used to minimize disk, memory, and CPU resource problems.  A
    limit of 0 disables filter limiting.  An average print to a
    non-PostScript printer needs a filter limit of about 200.  A PostScript
    printer needs about half that (100).  Setting the limit below these
    thresholds will effectively limit the scheduler to printing a single job
    at any time.
    
    Defaults to @samp{0}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} non-negative-integer filter-nice
    Specifies the scheduling priority of filters that are run to print a
    job.  The nice value ranges from 0, the highest priority, to 19, the
    lowest priority.
    
    Defaults to @samp{0}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} host-name-lookups host-name-lookups
    Specifies whether to do reverse lookups on connecting clients.  The
    @code{double} setting causes @code{cupsd} to verify that the hostname
    resolved from the address matches one of the addresses returned for that
    hostname.  Double lookups also prevent clients with unregistered
    addresses from connecting to your server.  Only set this option to
    @code{#t} or @code{double} if absolutely required.
    
    Defaults to @samp{#f}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} non-negative-integer job-kill-delay
    Specifies the number of seconds to wait before killing the filters and
    backend associated with a canceled or held job.
    
    Defaults to @samp{30}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} non-negative-integer job-retry-interval
    Specifies the interval between retries of jobs in seconds.  This is
    typically used for fax queues but can also be used with normal print
    queues whose error policy is @code{retry-job} or
    @code{retry-current-job}.
    
    Defaults to @samp{30}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} non-negative-integer job-retry-limit
    Specifies the number of retries that are done for jobs.  This is
    typically used for fax queues but can also be used with normal print
    queues whose error policy is @code{retry-job} or
    @code{retry-current-job}.
    
    Defaults to @samp{5}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} boolean keep-alive?
    Specifies whether to support HTTP keep-alive connections.
    
    Defaults to @samp{#t}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} non-negative-integer keep-alive-timeout
    Specifies how long an idle client connection remains open, in seconds.
    
    Defaults to @samp{30}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} non-negative-integer limit-request-body
    Specifies the maximum size of print files, IPP requests, and HTML form
    data.  A limit of 0 disables the limit check.
    
    Defaults to @samp{0}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} multiline-string-list listen
    Listens on the specified interfaces for connections.  Valid values are
    of the form @var{address}:@var{port}, where @var{address} is either an
    IPv6 address enclosed in brackets, an IPv4 address, or @code{*} to
    indicate all addresses.  Values can also be file names of local UNIX
    domain sockets.  The Listen directive is similar to the Port directive
    but allows you to restrict access to specific interfaces or networks.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} non-negative-integer listen-back-log
    Specifies the number of pending connections that will be allowed.  This
    normally only affects very busy servers that have reached the MaxClients
    limit, but can also be triggered by large numbers of simultaneous
    connections.  When the limit is reached, the operating system will
    refuse additional connections until the scheduler can accept the pending
    ones.
    
    Defaults to @samp{128}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} location-access-control-list location-access-controls
    Specifies a set of additional access controls.
    
    Available @code{location-access-controls} fields are:
    
    @deftypevr {@code{location-access-controls} parameter} file-name path
    Specifies the URI path to which the access control applies.
    @end deftypevr
    
    @deftypevr {@code{location-access-controls} parameter} access-control-list access-controls
    Access controls for all access to this path, in the same format as the
    @code{access-controls} of @code{operation-access-control}.
    
    Defaults to @samp{()}.
    @end deftypevr
    
    @deftypevr {@code{location-access-controls} parameter} method-access-control-list method-access-controls
    Access controls for method-specific access to this path.
    
    Defaults to @samp{()}.
    
    Available @code{method-access-controls} fields are:
    
    @deftypevr {@code{method-access-controls} parameter} boolean reverse?
    If @code{#t}, apply access controls to all methods except the listed
    methods.  Otherwise apply to only the listed methods.
    
    Defaults to @samp{#f}.
    @end deftypevr
    
    @deftypevr {@code{method-access-controls} parameter} method-list methods
    Methods to which this access control applies.
    
    Defaults to @samp{()}.
    @end deftypevr
    
    @deftypevr {@code{method-access-controls} parameter} access-control-list access-controls
    Access control directives, as a list of strings.  Each string should be
    one directive, such as "Order allow,deny".
    
    Defaults to @samp{()}.
    @end deftypevr
    @end deftypevr
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} non-negative-integer log-debug-history
    Specifies the number of debugging messages that are retained for logging
    if an error occurs in a print job.  Debug messages are logged regardless
    of the LogLevel setting.
    
    Defaults to @samp{100}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} log-level log-level
    Specifies the level of logging for the ErrorLog file.  The value
    @code{none} stops all logging while @code{debug2} logs everything.
    
    Defaults to @samp{info}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} log-time-format log-time-format
    Specifies the format of the date and time in the log files.  The value
    @code{standard} logs whole seconds while @code{usecs} logs microseconds.
    
    Defaults to @samp{standard}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} non-negative-integer max-clients
    Specifies the maximum number of simultaneous clients that are allowed by
    the scheduler.
    
    Defaults to @samp{100}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} non-negative-integer max-clients-per-host
    Specifies the maximum number of simultaneous clients that are allowed
    from a single address.
    
    Defaults to @samp{100}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} non-negative-integer max-copies
    Specifies the maximum number of copies that a user can print of each
    job.
    
    Defaults to @samp{9999}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} non-negative-integer max-hold-time
    Specifies the maximum time a job may remain in the @code{indefinite}
    hold state before it is canceled.  A value of 0 disables cancellation of
    held jobs.
    
    Defaults to @samp{0}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} non-negative-integer max-jobs
    Specifies the maximum number of simultaneous jobs that are allowed.  Set
    to 0 to allow an unlimited number of jobs.
    
    Defaults to @samp{500}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} non-negative-integer max-jobs-per-printer
    Specifies the maximum number of simultaneous jobs that are allowed per
    printer.  A value of 0 allows up to MaxJobs jobs per printer.
    
    Defaults to @samp{0}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} non-negative-integer max-jobs-per-user
    Specifies the maximum number of simultaneous jobs that are allowed per
    user.  A value of 0 allows up to MaxJobs jobs per user.
    
    Defaults to @samp{0}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} non-negative-integer max-job-time
    Specifies the maximum time a job may take to print before it is
    canceled, in seconds.  Set to 0 to disable cancellation of "stuck" jobs.
    
    Defaults to @samp{10800}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} non-negative-integer max-log-size
    Specifies the maximum size of the log files before they are rotated, in
    bytes.  The value 0 disables log rotation.
    
    Defaults to @samp{1048576}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} non-negative-integer multiple-operation-timeout
    Specifies the maximum amount of time to allow between files in a
    multiple file print job, in seconds.
    
    Defaults to @samp{300}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} string page-log-format
    Specifies the format of PageLog lines.  Sequences beginning with percent
    (@samp{%}) characters are replaced with the corresponding information,
    while all other characters are copied literally.  The following percent
    sequences are recognized:
    
    @table @samp
    @item %%
    insert a single percent character
    
    @item %@{name@}
    insert the value of the specified IPP attribute
    
    @item %C
    insert the number of copies for the current page
    
    @item %P
    insert the current page number
    
    @item %T
    insert the current date and time in common log format
    
    @item %j
    insert the job ID
    
    @item %p
    insert the printer name
    
    @item %u
    insert the username
    @end table
    
    A value of the empty string disables page logging.  The string @code{%p
    %u %j %T %P %C %@{job-billing@} %@{job-originating-host-name@}
    %@{job-name@} %@{media@} %@{sides@}} creates a page log with the
    standard items.
    
    Defaults to @samp{""}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} environment-variables environment-variables
    Passes the specified environment variable(s) to child processes; a list
    of strings.
    
    Defaults to @samp{()}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} policy-configuration-list policies
    Specifies named access control policies.
    
    Available @code{policy-configuration} fields are:
    
    @deftypevr {@code{policy-configuration} parameter} string name
    Name of the policy.
    @end deftypevr
    
    @deftypevr {@code{policy-configuration} parameter} string job-private-access
    Specifies an access list for a job's private values.  @code{@@ACL} maps
    to the printer's requesting-user-name-allowed or
    requesting-user-name-denied values.  @code{@@OWNER} maps to the job's
    owner.  @code{@@SYSTEM} maps to the groups listed for the
    @code{system-group} field of the @code{files-config} configuration,
    which is reified into the @code{cups-files.conf(5)} file.  Other
    possible elements of the access list include specific user names, and
    @code{@@@var{group}} to indicate members of a specific group.  The
    access list may also be simply @code{all} or @code{default}.
    
    Defaults to @samp{"@@OWNER @@SYSTEM"}.
    @end deftypevr
    
    @deftypevr {@code{policy-configuration} parameter} string job-private-values
    Specifies the list of job values to make private, or @code{all},
    @code{default}, or @code{none}.
    
    Defaults to @samp{"job-name job-originating-host-name
    job-originating-user-name phone"}.
    @end deftypevr
    
    @deftypevr {@code{policy-configuration} parameter} string subscription-private-access
    Specifies an access list for a subscription's private values.
    @code{@@ACL} maps to the printer's requesting-user-name-allowed or
    requesting-user-name-denied values.  @code{@@OWNER} maps to the job's
    owner.  @code{@@SYSTEM} maps to the groups listed for the
    @code{system-group} field of the @code{files-config} configuration,
    which is reified into the @code{cups-files.conf(5)} file.  Other
    possible elements of the access list include specific user names, and
    @code{@@@var{group}} to indicate members of a specific group.  The
    access list may also be simply @code{all} or @code{default}.
    
    Defaults to @samp{"@@OWNER @@SYSTEM"}.
    @end deftypevr
    
    @deftypevr {@code{policy-configuration} parameter} string subscription-private-values
    Specifies the list of job values to make private, or @code{all},
    @code{default}, or @code{none}.
    
    Defaults to @samp{"notify-events notify-pull-method notify-recipient-uri
    notify-subscriber-user-name notify-user-data"}.
    @end deftypevr
    
    @deftypevr {@code{policy-configuration} parameter} operation-access-control-list access-controls
    Access control by IPP operation.
    
    Defaults to @samp{()}.
    @end deftypevr
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} boolean-or-non-negative-integer preserve-job-files
    Specifies whether job files (documents) are preserved after a job is
    printed.  If a numeric value is specified, job files are preserved for
    the indicated number of seconds after printing.  Otherwise a boolean
    value applies indefinitely.
    
    Defaults to @samp{86400}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} boolean-or-non-negative-integer preserve-job-history
    Specifies whether the job history is preserved after a job is printed.
    If a numeric value is specified, the job history is preserved for the
    indicated number of seconds after printing.  If @code{#t}, the job
    history is preserved until the MaxJobs limit is reached.
    
    Defaults to @samp{#t}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} non-negative-integer reload-timeout
    Specifies the amount of time to wait for job completion before
    restarting the scheduler.
    
    Defaults to @samp{30}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} string rip-cache
    Specifies the maximum amount of memory to use when converting documents
    into bitmaps for a printer.
    
    Defaults to @samp{"128m"}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} string server-admin
    Specifies the email address of the server administrator.
    
    Defaults to @samp{"root@@localhost.localdomain"}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} host-name-list-or-* server-alias
    The ServerAlias directive is used for HTTP Host header validation when
    clients connect to the scheduler from external interfaces.  Using the
    special name @code{*} can expose your system to known browser-based DNS
    rebinding attacks, even when accessing sites through a firewall.  If the
    auto-discovery of alternate names does not work, we recommend listing
    each alternate name with a ServerAlias directive instead of using
    @code{*}.
    
    Defaults to @samp{*}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} string server-name
    Specifies the fully-qualified host name of the server.
    
    Defaults to @samp{"localhost"}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} server-tokens server-tokens
    Specifies what information is included in the Server header of HTTP
    responses.  @code{None} disables the Server header.  @code{ProductOnly}
    reports @code{CUPS}.  @code{Major} reports @code{CUPS 2}.  @code{Minor}
    reports @code{CUPS 2.0}.  @code{Minimal} reports @code{CUPS 2.0.0}.
    @code{OS} reports @code{CUPS 2.0.0 (@var{uname})} where @var{uname} is
    the output of the @code{uname} command.  @code{Full} reports @code{CUPS
    2.0.0 (@var{uname}) IPP/2.0}.
    
    Defaults to @samp{Minimal}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} string set-env
    Set the specified environment variable to be passed to child processes.
    
    Defaults to @samp{"variable value"}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} multiline-string-list ssl-listen
    Listens on the specified interfaces for encrypted connections.  Valid
    values are of the form @var{address}:@var{port}, where @var{address} is
    either an IPv6 address enclosed in brackets, an IPv4 address, or
    @code{*} to indicate all addresses.
    
    Defaults to @samp{()}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} ssl-options ssl-options
    Sets encryption options.  By default, CUPS only supports encryption
    using TLS v1.0 or higher using known secure cipher suites.  The
    @code{AllowRC4} option enables the 128-bit RC4 cipher suites, which are
    required for some older clients that do not implement newer ones.  The
    @code{AllowSSL3} option enables SSL v3.0, which is required for some
    older clients that do not support TLS v1.0.
    
    Defaults to @samp{()}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} boolean strict-conformance?
    Specifies whether the scheduler requires clients to strictly adhere to
    the IPP specifications.
    
    Defaults to @samp{#f}.
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} non-negative-integer timeout
    Specifies the HTTP request timeout, in seconds.
    
    Defaults to @samp{300}.
    
    @end deftypevr
    
    @deftypevr {@code{cups-configuration} parameter} boolean web-interface?
    Specifies whether the web interface is enabled.
    
    Defaults to @samp{#f}.
    @end deftypevr
    
    At this point you're probably thinking ``oh dear, Guix manual, I like
    you but you can stop already with the configuration options''.  Indeed.
    However, one more point: it could be that you have an existing
    @code{cupsd.conf} that you want to use.  In that case, you can pass an
    @code{opaque-cups-configuration} as the configuration of a
    @code{cups-service-type}.
    
    Available @code{opaque-cups-configuration} fields are:
    
    @deftypevr {@code{opaque-cups-configuration} parameter} package cups
    The CUPS package.
    @end deftypevr
    
    @deftypevr {@code{opaque-cups-configuration} parameter} string cupsd.conf
    The contents of the @code{cupsd.conf}, as a string.
    @end deftypevr
    
    @deftypevr {@code{opaque-cups-configuration} parameter} string cups-files.conf
    The contents of the @code{cups-files.conf} file, as a string.
    @end deftypevr
    
    For example, if your @code{cupsd.conf} and @code{cups-files.conf} are in
    strings of the same name, you could instantiate a CUPS service like
    this:
    
    @example
    (service cups-service-type
             (opaque-cups-configuration
               (cupsd.conf cupsd.conf)
               (cups-files.conf cups-files.conf)))
    @end example
    
    
    
    @node Desktop Services
    @subsubsection Desktop Services
    
    The @code{(gnu services desktop)} module provides services that are
    usually useful in the context of a ``desktop'' setup---that is, on a
    machine running a graphical display server, possibly with graphical user
    
    interfaces, etc.  It also defines services that provide specific desktop
    environments like GNOME and XFCE.
    
    To simplify things, the module defines a variable containing the set of
    services that users typically expect on a machine with a graphical
    environment and networking:
    
    @defvr {Scheme Variable} %desktop-services
    This is a list of services that builds upon @var{%base-services} and
    
    adds or adjusts services for a typical ``desktop'' setup.
    
    
    In particular, it adds a graphical login manager (@pxref{X Window,
    
    @code{slim-service}}), screen lockers,
    a network management tool (@pxref{Networking
    
    Services, @code{wicd-service}}), energy and color management services,
    
    the @code{elogind} login and seat manager, the Polkit privilege service,
    
    the GeoClue location service, an NTP client (@pxref{Networking
    Services}), the Avahi daemon, and has the name service switch service
    configured to be able to use @code{nss-mdns} (@pxref{Name Service
    Switch, mDNS}).
    
    @end defvr
    
    The @var{%desktop-services} variable can be used as the @code{services}
    field of an @code{operating-system} declaration (@pxref{operating-system
    Reference, @code{services}}).
    
    
    Additionally, the @code{gnome-desktop-service} and
    @code{xfce-desktop-service} procedures can add GNOME and/or XFCE to a
    system.  To ``add GNOME'' means that system-level services like the
    backlight adjustment helpers and the power management utilities are
    added to the system, extending @code{polkit} and @code{dbus}
    appropriately, allowing GNOME to operate with elevated privileges on a
    limited number of special-purpose system interfaces.  Additionally,
    adding a service made by @code{gnome-desktop-service} adds the GNOME
    metapackage to the system profile.  Likewise, adding the XFCE service
    not only adds the @code{xfce} metapackage to the system profile, but it
    also gives the Thunar file manager the ability to open a ``root-mode''
    file management window, if the user authenticates using the
    administrator's password via the standard polkit graphical interface.
    
    @deffn {Scheme Procedure} gnome-desktop-service
    Return a service that adds the @code{gnome} package to the system
    profile, and extends polkit with the actions from
    @code{gnome-settings-daemon}.
    @end deffn
    
    @deffn {Scheme Procedure} xfce-desktop-service
    Return a service that adds the @code{xfce} package to the system profile,
    
    Alex Kost's avatar
    Alex Kost committed
    and extends polkit with the ability for @code{thunar} to manipulate the
    
    file system as root from within a user session, after the user has
    authenticated with the administrator's password.
    @end deffn
    
    Because the GNOME and XFCE desktop services pull in so many packages,
    the default @code{%desktop-services} variable doesn't include either of
    them by default.  To add GNOME or XFCE, just @code{cons} them onto
    @code{%desktop-services} in the @code{services} field of your
    @code{operating-system}:
    
    @example
    (use-modules (gnu))
    (use-service-modules desktop)
    (operating-system
      ...
      ;; cons* adds items to the list given as its last argument.
      (services (cons* (gnome-desktop-service)
                       (xfce-desktop-service)
                       %desktop-services))
      ...)
    @end example
    
    These desktop environments will then be available as options in the
    graphical login window.
    
    The actual service definitions included in @code{%desktop-services} and
    provided by @code{(gnu services dbus)} and @code{(gnu services desktop)}
    are described below.
    
    @deffn {Scheme Procedure} dbus-service [#:dbus @var{dbus}] [#:services '()]
    
    Return a service that runs the ``system bus'', using @var{dbus}, with
    support for @var{services}.
    
    @uref{http://dbus.freedesktop.org/, D-Bus} is an inter-process communication
    facility.  Its system bus is used to allow system services to communicate
    
    and to be notified of system-wide events.
    
    @var{services} must be a list of packages that provide an
    @file{etc/dbus-1/system.d} directory containing additional D-Bus configuration
    and policy files.  For example, to allow avahi-daemon to use the system bus,
    @var{services} must be equal to @code{(list avahi)}.
    
    Alex Kost's avatar
    Alex Kost committed
    @end deffn
    
    
    @deffn {Scheme Procedure} elogind-service [#:config @var{config}]
    
    Return a service that runs the @code{elogind} login and
    seat management daemon.  @uref{https://github.com/andywingo/elogind,
    Elogind} exposes a D-Bus interface that can be used to know which users
    are logged in, know what kind of sessions they have open, suspend the
    system, inhibit system suspend, reboot the system, and other tasks.
    
    Elogind handles most system-level power events for a computer, for
    example suspending the system when a lid is closed, or shutting it down
    when the power button is pressed.
    
    The @var{config} keyword argument specifies the configuration for
    
    elogind, and should be the result of an @code{(elogind-configuration
    
    (@var{parameter} @var{value})...)} invocation.  Available parameters and
    their default values are:
    
    @table @code
    @item kill-user-processes?
    @code{#f}
    @item kill-only-users
    @code{()}
    @item kill-exclude-users
    @code{("root")}
    @item inhibit-delay-max-seconds
    @code{5}
    @item handle-power-key
    @code{poweroff}
    @item handle-suspend-key
    @code{suspend}
    @item handle-hibernate-key