unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* proposal: (define (find-guix-packages list-of-names) ... )
@ 2015-11-12  8:21 Florian Paul Schmidt
  2015-11-15 20:35 ` Ludovic Courtès
  0 siblings, 1 reply; 9+ messages in thread
From: Florian Paul Schmidt @ 2015-11-12  8:21 UTC (permalink / raw)
  To: guix-devel

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

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

end of thread, other threads:[~2015-11-29 11:32 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-12  8:21 proposal: (define (find-guix-packages list-of-names) ... ) Florian Paul Schmidt
2015-11-15 20:35 ` 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

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