From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pierre Neidhardt Subject: [Blog/Cookbook?] On multiple Guix profiles and manifests Date: Sat, 05 Oct 2019 12:55:39 +0200 Message-ID: <87y2xzihqs.fsf@ambrevar.xyz> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:43947) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iGhj1-00019S-D7 for help-guix@gnu.org; Sat, 05 Oct 2019 06:55:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iGhiz-0000yM-LS for help-guix@gnu.org; Sat, 05 Oct 2019 06:55:46 -0400 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" To: help-guix@gnu.org, guix-blog@gnu.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi! While the documentation refers to profiles and manifests, it does not tell = much of the use cases and the practical benefits. For users coming from non-functional package managers, it's not really obvi= ous why we would need profiles. Regarding manifest, I suppose some people might find them annoying to use because updating/adding just 1 program means rebuilding the whole profile, = which after a Guix pull can be somewhat lengthy. So what about writing a blog article / cookbook chapter to explain why profiles and manifests are truly awesome indeed? (Unless this has already been done and I missed it?) A quick 'n' dirty outline: A manifest can be slow to install if it's too big. But Guix supports profi= le, which are perfect to break down manifests into multiple sets of semantically connected packages. Example profiles: =2D Emacs. =2D TeXlive (this one can be really useful when you need to install just one package for the next document you've received over email). =2D Your favourite programming language libraries. =2D The dependencies of a project you are working on =2D Games :p We can create a manifest per profile and install them this way: guix package --manifest=3D/path/to/guix-dev-manifest.scm --profile=3D$HO= ME/.guix-extra-profiles/dev/dev =20=20 Placing all your profiles in a single folder, with each profile getting its= own subfolder is somewhat cleaner, plus it's obvious to "loop over profiles" fr= om any programming language (e.g. a shell script) by simply looping over the sub-directories of .guix-extra-profiles. Note that it's also possible to loop over the output of `guix package =2D-list-profiles` although you'll probably have to filter out `~/.config/guix/current`. To "enable" all profiles on login, add this to your .bash_profile (or .prof= ile if you don't use bash): #+begin_src sh for i in ~/.guix-extra-profiles/*; do profile=3D$i/$(basename "$i") if [ -f "$profile"/etc/profile ]; then GUIX_PROFILE=3D"$profile" ; . "$profile"/etc/profile fi unset profile done #+end_src I like to keep the default ~/.guix-profile manifest-less for trash-away pac= kages that I would just use for a couple of days.=20=20 This way it's easy to just run guix install FOO guix upgrade BAR =20=20 and I don't have to specify the profile. Other benefits of manifests: =2D No need to generate or maintain a manifest from an ad-hoc profile. =20=20 =2D "guix package -u" will always suggest to update some packages of those = have propagated inputs. Guix manifests avoid this problem. =20=20 =2D "guix package -u [packages...]" may report conflicts which are annoying= to resolve manually. Manifests avoid this problem altogether. Other benefits of multiple profiles =2D It's easy to toggle a specific profile on/off. =20=20 =2D When a profile is off, it's easy to enable it for an individual shell w= ithout "polluting" the rest of the user session: #+begin_src sh GUIX_PROFILE=3D"$profile" ; . "$profile"/etc/profile=20 #+end_src Happy to hear about your feedback! Cheers! =2D-=20 Pierre Neidhardt https://ambrevar.xyz/ --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAl2YdqsACgkQm9z0l6S7 zH/Ybgf+PdjuMsYpn4QXV6a2rqowNWlaIcalPKzQTAg2QeTJPwou268698ofpsgf 6EvtjZrO6SSpGzUw2VeXQ9idkjP7EwPV3DcIMfjWEreMkUoaDzk8T1kwAhISzXJP FmYzDGZ6UgHw0oBDxzMDXQpH9m3YILPOiPVHLPL0gdPMEWJc0nbnWpPK7RK9H+Wz YEcoVAcrGWuFY5vzdJ782HvY2uo//aLq1mbUgIhdM3Ima4BK5PKEpux7yuGPkRAQ ETQhTEXYEYs4UXNkF8bR2XfUmqiT9LyyRQ2Kvv5HRuH93LKX/xJjTXyaxjPdwIIF alz5HzXPnOIikCOP+2ByR4uJsCJ75Q== =Vpw4 -----END PGP SIGNATURE----- --=-=-=--