Hello Guix! For some time we’ve discussed ways to achieve “parameterized packages”—packages where one can from the command line or from Scheme configure optional build-time features, similar to Gentoo “USE flags”. I still have mixed feeling about this feature: on one hand it can bring much welcome flexibility, but on the other hand it can also lead us to the wild west of untested package configurations and combinatorial explosion. It could also be argued that we achieve something similar today by simply defining package variants when we have to: https://guix.gnu.org/manual/devel/en/html_node/Defining-Package-Variants.html That said, this message is about a possible implementation of package parameters, so here we go. :-) To me the requirements for package parameters are: 1. it must be possible to discover them and choose them from the UI; 2. they must contain on-line internationalized documentation such that the UI can list a package’s parameters and their type; 3. the chosen parameters when installing a package in a profile must be preserved; 4. it must be possible to enumerate all the possible values of a parameter, and thus to build the Cartesian product of all the possible parameter combinations of a package (or of a package graph!), so we can test those combinations as much as possible. This leads to the patches below. The last one gives an example use for Bitlbee: it adds a “libpurple” parameter that allows users to choose whether or not to enable the optional libpurple dependency: --8<---------------cut here---------------start------------->8--- $ ./pre-inst-env guix build bitlbee --with-parameter=bitlbee=libpurple=true -n The following derivation would be built: /gnu/store/mkknqgjsa93ajcl5d2krngizb11j1b0q-bitlbee-3.6.drv $ ./pre-inst-env guix build bitlbee --with-parameter=bitlbee=libpurple=false -n /gnu/store/c2ckg51ffwgs6jni3l549k06w3jd3b7a-bitlbee-3.6 $ ./pre-inst-env guix build bitlbee --with-parameter=bitlbee=libpurple=wat? -n guix build: error: wrong value $ ./pre-inst-env guix build bitlbee --with-parameter=bitlbee=libviolet=true -n gnu/packages/messaging.scm:283:5: error: libviolet: no such package parameter $ ./pre-inst-env guix show bitlbee name: bitlbee version: 3.6 outputs: out parameters: libpurple systems: x86_64-linux i686-linux dependencies: check@0.12.0 glib@2.62.6 gnutls@3.6.12 libotr@4.1.1 perl@5.30.2 pkg-config@0.29.2 python@3.8.2 location: gnu/packages/messaging.scm:243:2 homepage: https://www.bitlbee.org/ license: GPL 2+, FreeBSD synopsis: IRC to instant messaging gateway description: BitlBee brings IM (instant messaging) to IRC clients, for people who have an IRC client running all + the time and don't want to run an additional IM client. BitlBee currently supports XMPP/Jabber (including Google + Talk), MSN Messenger, Yahoo! Messenger, AIM and ICQ, and the Twitter microblogging network (plus all other Twitter + API compatible services like identi.ca and status.net). $ ./pre-inst-env guix install bitlbee --with-parameter=bitlbee=libpurple=true -p /tmp/test-bitlbee The following package will be installed: bitlbee 3.6 The following derivation will be built: /gnu/store/clvs5521v5ybdw1z1yh97z2ky1dxm4d9-bitlbee-3.6.drv [...] $ cat /tmp/test-bitlbee/manifest ;; This file was automatically generated and is for internal use only. ;; It cannot be passed to the '--manifest' option. (manifest (version 3) (packages (("bitlbee" "3.6" "out" "/gnu/store/d67r9k5hwfm5hkd1d3pbhg49fcc2jj4q-bitlbee-3.6" (propagated-inputs ()) (search-paths ()) (properties (transformations (with-parameter . "bitlbee=libpurple=true"))))))) --8<---------------cut here---------------end--------------->8--- That’s it! We would need more things, like a ‘guix parameters’ command to show the available parameters of a package and an ‘--all-parameter-values’ option to ‘guix build’ to build all the variants of a given package. An important question: do we have examples of packages for which we’d like to have parameters? I’d grepped for “inherit” and that yields a few potential candidates, but also maybe a few potential non-candidates. Would this be a good fit for them? Thoughts? Ludo’.