unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Florian Paul Schmidt <mista.tapas@gmx.net>
To: guix-devel@gnu.org
Subject: proposal: (define (find-guix-packages list-of-names) ... )
Date: Thu, 12 Nov 2015 09:21:16 +0100	[thread overview]
Message-ID: <56444BFC.70800@gmx.net> (raw)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256


Hi, I found a procedure like this (then at the top of my system
config.scm's) to be quite useful:

diff --git a/gnu/packages.scm b/gnu/packages.scm
index fb27738..63500ab 100644
- --- a/gnu/packages.scm
+++ b/gnu/packages.scm
@@ -228,6 +228,14 @@ decreasing version order."
                     matching)
             matching)))))

+(define (find-guix-packages list-of-names)
+  (map
+   car
+   (map
+    find-packages-by-name
+    list-of-names)))
+
+
 (define find-newest-available-packages
   (memoize
    (lambda ()


Which could be used in the config like this (for example):

;; Globally-installed packages.
  (packages
   (append
    (find-guix-packages
     '("htop"
       "wget"
       "xmonad"
       "openssh"
       "dmenu"
       "git"
       "xterm"
       "emacs"))
    %base-packages))

and which saves the user from manually entering the use-modules for
the module packages at the top of the config.

I am aware that is maybe still too simplistic. E.g.: It might be good
to check if the name is ambiguous instead of just taking the first
result and throw an error in that case.

As a typical programmer I am allergic to seemingly redundant and
automatable tasks, so I'd love to see something at least similar in
spirit in guix.

Thoughts?

Regards,
Flo


- -- 
https://fps.io
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJWREv5AAoJEA5f4Coltk8Zd10H+wQTkueXnBzYYpPtVNaXRveE
auyz9KXzcBDWw9vBSMnJjup3vG8bLIpniqQBjhTM1s29h60Z4bN/BNBq3Hnmee9s
Fec0pRqIL2tcbenP4hIov56nfxjgg7hDp9ZCKZ/VBy5ROGArc4OLiiaMuaZxiB1N
ph4uR4JDnm+YAWavv3DOBFn4czFhQSokTmW6uPdq5pgJznqP6FtV/fR281eQO65K
1ZnkCRxYiVwVlm+wfg9dCGORm1hu+qXwwzUkIGJ4F09IIVQUwoItzHjDcOHGs+Db
h4ltuNlvX4mUUB8NQO2tC/dWIGCAXX8SBvTJXIEN3wzzG4G6PO84aycU37zVvY4=
=7PjJ
-----END PGP SIGNATURE-----

             reply	other threads:[~2015-11-12  8:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-12  8:21 Florian Paul Schmidt [this message]
2015-11-15 20:35 ` proposal: (define (find-guix-packages list-of-names) ... ) Ludovic Courtès
2015-11-15 21:25   ` Florian Paul Schmidt
2015-11-16 13:03     ` Ludovic Courtès
2015-11-16 19:31       ` Florian Paul Schmidt
2015-11-16 20:06         ` Ludovic Courtès
2015-11-20 18:21           ` Florian Paul Schmidt
2015-11-28 15:39             ` Ludovic Courtès
2015-11-29 11:32               ` Florian Paul Schmidt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56444BFC.70800@gmx.net \
    --to=mista.tapas@gmx.net \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

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).