From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kost Subject: Re: Problems when trying to install a package via guile API Date: Thu, 14 Aug 2014 08:46:16 +0400 Message-ID: <87d2c3el0n.fsf@gmail.com> References: <87zjf7iyce.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> 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]:43226) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHmvg-0005gB-VH for guix-devel@gnu.org; Thu, 14 Aug 2014 00:46:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XHmvX-0003mv-TE for guix-devel@gnu.org; Thu, 14 Aug 2014 00:46:24 -0400 Received: from mail-lb0-x230.google.com ([2a00:1450:4010:c04::230]:42947) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHmvX-0003md-Ki for guix-devel@gnu.org; Thu, 14 Aug 2014 00:46:15 -0400 Received: by mail-lb0-f176.google.com with SMTP id u10so528615lbd.7 for ; Wed, 13 Aug 2014 21:46:14 -0700 (PDT) In-Reply-To: <87zjf7iyce.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> (David Thompson's message of "Wed, 13 Aug 2014 22:44:49 -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 Hello, David Thompson (2014-08-14 06:44 +0400) wrote: > Hello all, > > I'm trying to learn to use the Guix API to install packages so that I > can write a web frontend. However, I'm running into issues when trying > to create a derivation. > > Here's a problematic code snippet: > > (use-modules (guix derivations) > (guix monads) > (guix packages) > (guix profiles) > (guix store) > (gnu packages guile)) > > (define %store (open-connection)) > (define profile "/usr/var/guix/profiles/per-user/dave/guix-profile") > (define manifest (profile-manifest profile)) > (define new (manifest-add manifest > (list (package->manifest-entry guile-2.0)))) > (define prof-drv (run-with-store %store > (profile-derivation new))) > > The error: > > ERROR: In procedure #: > ERROR: Wrong type to apply: # > > 0 (# #) > > I've been slowly figuring things out by reading > guix/scripts/package.scm, but I can't seem to get this part right. Does > anyone have an idea of what I'm doing wrong? Your code works for me, do you use the latest "guix pull"? I vaguely recall that I had some that was cured by "guix pull".