summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Graves <ngraves@ngraves.fr>2026-04-03 10:04:57 +0200
committerLudovic Courtès <ludo@gnu.org>2026-05-07 17:34:44 +0200
commit10bf5b6c2975088828c0b151d17cbb3e451d300c (patch)
treeaeea3a587961a77b46c716a5b7dce85446cbe118
parentc7871f61115e62070ddfad40906a19eea417037d (diff)
doc: Rebalance guix style inputs description.
* doc/guix.texi: It seems that there were two places where styling rules were declared, and one was vastly outdated. Only describe styling rules once instead, and move their specific discussion where the styling rule is described. Change-Id: Ic83d4c59e45ed51f63dfe91e624b6f453a800818 Signed-off-by: Ludovic Courtès <ludo@gnu.org>
-rw-r--r--doc/guix.texi86
1 files changed, 38 insertions, 48 deletions
diff --git a/doc/guix.texi b/doc/guix.texi
index 5a6ddf44ad7..70677e24446 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -15994,51 +15994,10 @@ Use @var{host} as the OpenPGP key server when importing a public key.
15994@cindex format conventions 15994@cindex format conventions
15995The @command{guix style} command helps users and packagers alike style 15995The @command{guix style} command helps users and packagers alike style
15996their package definitions and configuration files according to the 15996their package definitions and configuration files according to the
15997latest fashionable trends. It can either reformat whole files, with the 15997latest fashionable trends, or patch them with specific rewrites. It can
15998@option{--whole-file} option, or apply specific @dfn{styling rules} to 15998either reformat whole files, with the @option{--whole-file} option, or
15999individual package definitions. The command currently provides the 15999apply specific @dfn{styling rules} to individual package definitions.
16000following styling rules: 16000The command provides multiple styling rules, explained below.
16001
16002@itemize
16003@item
16004formatting package definitions according to the project's conventions
16005(@pxref{Formatting Code});
16006
16007@item
16008rewriting package inputs to the ``new style'', as explained below.
16009@end itemize
16010
16011The way package inputs are written is going through a transition
16012(@pxref{package Reference}, for more on package inputs). Until version
160131.3.0, package inputs were written using the ``old style'', where each
16014input was given an explicit label, most of the time the package name:
16015
16016@lisp
16017(package
16018 ;; @dots{}
16019 ;; The "old style" (deprecated).
16020 (inputs `(("libunistring" ,libunistring)
16021 ("libffi" ,libffi))))
16022@end lisp
16023
16024Today, the old style is deprecated and the preferred style looks like
16025this:
16026
16027@lisp
16028(package
16029 ;; @dots{}
16030 ;; The "new style".
16031 (inputs (list libunistring libffi)))
16032@end lisp
16033
16034Likewise, uses of @code{alist-delete} and friends to manipulate inputs
16035is now deprecated in favor of @code{modify-inputs} (@pxref{Defining
16036Package Variants}, for more info on @code{modify-inputs}).
16037
16038In the vast majority of cases, this is a purely mechanical change on the
16039surface syntax that does not even incur a package rebuild. Running
16040@command{guix style -S inputs} can do that for you, whether you're working on
16041packages in Guix proper or in an external channel.
16042 16001
16043The general syntax is: 16002The general syntax is:
16044 16003
@@ -16101,14 +16060,45 @@ definition of the Coreutils package like so:
16101@end example 16060@end example
16102 16061
16103@item inputs 16062@item inputs
16104Rewrite package inputs to the ``new style'', as described above. This 16063Rewrite package inputs to the ``new style''. This is how you would
16105is how you would rewrite inputs of package @code{whatnot} in your own 16064rewrite inputs of package @code{whatnot} in your own channel:
16106channel:
16107 16065
16108@example 16066@example
16109guix style -L ~/my/channel -S inputs whatnot 16067guix style -L ~/my/channel -S inputs whatnot
16110@end example 16068@end example
16111 16069
16070The way package inputs are written is going through a transition
16071(@pxref{package Reference}, for more on package inputs). Until version
160721.3.0, package inputs were written using the ``old style'', where each
16073input was given an explicit label, most of the time the package name:
16074
16075@lisp
16076(package
16077 ;; @dots{}
16078 ;; The "old style" (deprecated).
16079 (inputs `(("libunistring" ,libunistring)
16080 ("libffi" ,libffi))))
16081@end lisp
16082
16083Today, the old style is deprecated and the preferred style looks like
16084this:
16085
16086@lisp
16087(package
16088 ;; @dots{}
16089 ;; The "new style".
16090 (inputs (list libunistring libffi)))
16091@end lisp
16092
16093Likewise, uses of @code{alist-delete} and friends to manipulate inputs
16094is now deprecated in favor of @code{modify-inputs} (@pxref{Defining
16095Package Variants}, for more info on @code{modify-inputs}).
16096
16097In the vast majority of cases, this is a purely mechanical change on the
16098surface syntax that does not even incur a package rebuild. Running
16099@command{guix style -S inputs} can do that for you, whether you're working on
16100packages in Guix proper or in an external channel.
16101
16112Rewriting is done in a conservative way: preserving comments and bailing 16102Rewriting is done in a conservative way: preserving comments and bailing
16113out if it cannot make sense of the code that appears in an inputs field. 16103out if it cannot make sense of the code that appears in an inputs field.
16114The @option{--input-simplification} option described below provides 16104The @option{--input-simplification} option described below provides