From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Reproducible profiles Date: Sat, 16 May 2015 13:16:38 +0200 Message-ID: <87egmgu609.fsf@gnu.org> References: <87pp62iqmn.fsf@fsf.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53622) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yta5K-0004A2-Un for guix-devel@gnu.org; Sat, 16 May 2015 07:16:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yta5H-0001hT-PN for guix-devel@gnu.org; Sat, 16 May 2015 07:16:50 -0400 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39268) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yta5H-0001hN-Lu for guix-devel@gnu.org; Sat, 16 May 2015 07:16:47 -0400 In-Reply-To: <87pp62iqmn.fsf@fsf.org> (David Thompson's message of "Thu, 14 May 2015 21:19:44 -0400") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: David Thompson Cc: guix-devel@gnu.org David Thompson skribis: > Lately I've been wanting to version control the list of packages that I > install in my user profile so that I can sync it amongst many machines. > So, I took a stab at adding a new '--apply' option to 'guix package' > that reads in a package list from a Scheme file and creates a new > generation of the profile with only those packages are installed. > Here's an example configuration: > > (use-modules (gnu)) > (use-package-modules base less guile emacs admin ruby mail pumpio man) >=20=20=20=20=20 > (list ruby > coreutils > less > man-db > notmuch > guile-2.0 > emacs > dmd > offlineimap > pumpa) Yes, that sounds very useful. As usual though, there=E2=80=99s the issue of multiple-output packages. The above snippet is nice, but doesn=E2=80=99t allow you to specify a particular output of a package. What about instead requiring people to return a manifest: (use-modules (guix profiles)) (use-package-modules base emacs guile) (manifest (cons (package->manifest-entry gcc-toolchain "debug") (map package->entry (list gcc-toolchain emacs guile-2.0)))) That means we=E2=80=99ll have to document (guix profiles). It=E2=80=99s more verbose than what you suggest, though. If you insist ;-)= , we could allow a list of packages instead of a manifest, though I=E2=80=99d pr= efer not to do that. WDYT? > Below is a naive patch that does the job, but is unideal because it > doesn't do some nice things like display the diff between generations > before building. For that you would need a procedure to infer the manifest transaction: (manifests->transaction m1 m2) ;; returns a and then that could be passed to =E2=80=98show-manifest-transaction=E2=80= =99. However, I=E2=80=99m not sure it=E2=80=99s very useful. Perhaps it would b= e enough to write =E2=80=9Cinstalling new manifest from foo.scm with 42 entries.=E2=80= =9D WDYT? > I'm looking for some guidance to make this option mesh better with the > rest of the 'guix package' utility. Any help is appreciated. Overall it looks OK to me! [...] > + (option '("apply") #t #f > + (lambda (opt name arg result arg-handler) > + (values (alist-cons 'apply (load arg) result) > + arg-handler))) It would be better to delay loading until after arguments have been parsed, as in =E2=80=98guix system=E2=80=99. The procedure to load the fil= e should be similar to =E2=80=98read-operating-system=E2=80=99. We=E2=80=99ll need documentation and tests, too. :-) Thank you! Ludo=E2=80=99.