unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Trouble installing bind using home-configuration.scm/config.scm
@ 2024-10-25 11:46 Lee Thompson
  2024-10-25 11:55 ` Andreas Enge
  2024-10-25 12:28 ` Tobias Geerinckx-Rice
  0 siblings, 2 replies; 3+ messages in thread
From: Lee Thompson @ 2024-10-25 11:46 UTC (permalink / raw)
  To: help-guix

I'm having trouble installing the `bind' package declaratively.  Running
`guix show bind' returns the bind package, but when I add `(gnu packages
dns)' to my home-configuration.scm and the bind package to `packages'
like so I run into an exception during reconfiguration:
> (use-modules (gnu home)
>              (gnu home services)
>              (gnu packages)
>              …
>              (gnu packages dns))
> 
> (home-environment
>   (packages (list …
>                   bind
>                   …)))
>   (services …)

After running `guix home reconfigure
~/.config/guix-config/home-configuration.scm':
> …
> In gnu/home/services.scm:
>    167:37  8 (_ #<store-connection 256.100 7fd2ba4d7a50>)
> In guix/profiles.scm:
>     439:4  7 (packages->manifest _)
> In srfi/srfi-1.scm:
>    586:29  6 (map1 (#<package htop@3.3.0 gnu/packages/admin.scm:8…> …))
>    586:17  5 (map1 (#<procedure bind (_ _ #:optional _ . _)> #<pa…> …))
> In guix/inferior.scm:
>     560:2  4 (loop #<procedure bind (_ _ #:optional _ . _)> "out" #<…>)
>     540:4  3 (inferior-package-input-field #<procedure bind (_ _ #:…> …)
>    484:18  2 (inferior-package-field #<procedure bind (_ _ #:option…> …)
> In ice-9/boot-9.scm:
>   1685:16  1 (raise-exception _ #:continuable? _)
>   1685:16  0 (raise-exception _ #:continuable? _)
> 
> ice-9/boot-9.scm:1685:16: In procedure raise-exception:
> In procedure struct-vtable: Wrong type argument in position 1 (expecting struct): #<procedure bind (_ _ #:optional _ . _)>

It looks pretty obvious that this is having some interaction with the
standard Guile `bind' procedure.  Is this intended behaviour?  I can
imagine using `specification->package' could get around this but I
wanted to hear some other opinions.

Also while looking into this I found this section of the info manual
that talks about an `isc-bind' package I've been unable to get Guix to
find; is this a former name of the current `bind' package?  Relevant
info section:
> Globally-Visible Packages
> -------------------------
> 
> The ‘packages’ field lists packages that will be globally visible on the
> system, for all user accounts—i.e., in every user’s ‘PATH’ environment
> variable—in addition to the per-user profiles (*note Invoking guix
> package::).  The ‘%base-packages’ variable provides all the tools one
> would expect for basic user and administrator tasks—including the GNU
> Core Utilities, the GNU Networking Utilities, the ‘mg’ lightweight text
> editor, ‘find’, ‘grep’, etc.  The example above adds GNU Screen to
> those, taken from the ‘(gnu packages screen)’ module (*note Package
> Modules::).  The ‘(list package output)’ syntax can be used to add a
> specific output of a package:
> 
>      (use-modules (gnu packages))
>      (use-modules (gnu packages dns))
> 
>      (operating-system
>        ;; ...
>        (packages (cons (list isc-bind "utils")
>                        %base-packages)))


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Trouble installing bind using home-configuration.scm/config.scm
  2024-10-25 11:46 Trouble installing bind using home-configuration.scm/config.scm Lee Thompson
@ 2024-10-25 11:55 ` Andreas Enge
  2024-10-25 12:28 ` Tobias Geerinckx-Rice
  1 sibling, 0 replies; 3+ messages in thread
From: Andreas Enge @ 2024-10-25 11:55 UTC (permalink / raw)
  To: Lee Thompson; +Cc: help-guix

Hello,

Am Fri, Oct 25, 2024 at 12:46:05PM +0100 schrieb Lee Thompson:
> > (home-environment
> >   (packages (list …
> >                   bind
> >                   …)))
> >   (services …)

you need to distinguish the name of a package, as given as a string in its
name field and used on the command line, and the variable name used inside
the Guile code of Guix. Usually, they are the same. But when you do
"guix edit bind":
(define-public isc-bind
  (package
    (name "bind")
...
Supposedly this is due to the name clash with an already existing Guile
procedure you mention.

So either use the varible name isc-bind in your code, or
(specification->package "bind")

Andreas



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Trouble installing bind using home-configuration.scm/config.scm
  2024-10-25 11:46 Trouble installing bind using home-configuration.scm/config.scm Lee Thompson
  2024-10-25 11:55 ` Andreas Enge
@ 2024-10-25 12:28 ` Tobias Geerinckx-Rice
  1 sibling, 0 replies; 3+ messages in thread
From: Tobias Geerinckx-Rice @ 2024-10-25 12:28 UTC (permalink / raw)
  To: help-guix, Lee Thompson

Hi Lee,

This is not an answer to your question, which Andreas already nailed.

It's more common that people install BIND as a package (not service) because they want the CLI tools, most notably ‘dig’, instead of the BIND daemon itself.

These tools are installed into a separate bind:utils package output.

To select an output using a package ‘specification’ (=a string as used on the Guix CLI):

  (packages
    (append (map (compose list specification->package+output)
                     (list "bind:utils"
                           "hello"
                           "etc"))
            ;; This example mixes specs and variables for no good reason:
            (list some-other-package
                  or-not)))

Or if you prefer plain Scheme variables (as do I):

  (packages
    (list (list bind "utils") ;nested (package "output") list
          some-other-package  ;plain package variable
          or-not)))

If you actually want BIND proper—or already knew all this!—my apologies for being presumptuous.  I just wanted to pre-empt a possible follow-up thread.

Kind regards,

T G-R

Sent on the go.  Excuse or enjoy my brevity.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-10-25 12:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-25 11:46 Trouble installing bind using home-configuration.scm/config.scm Lee Thompson
2024-10-25 11:55 ` Andreas Enge
2024-10-25 12:28 ` Tobias Geerinckx-Rice

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).