[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How do I install packages from a file without removing currently ins
From: |
sirgazil |
Subject: |
Re: How do I install packages from a file without removing currently installed packages? |
Date: |
Sat, 11 May 2019 10:55:17 -0500 |
User-agent: |
Zoho Mail |
Hi Giovanni,
---- On Sat, 11 May 2019 03:30:34 -0500 Giovanni Biscuolo <address@hidden>
wrote ----
> Hello sirgazil,
>
> sirgazil <address@hidden> writes:
>
> [...]
>
> > Is there any way to tell Guix to create a generation that is the
> > aggregate of the packages installed in the current generation and the
> > packages specified in the manifest file?
>
> no way to aggregate packages this way in the same profile (default
> profile I imagine), you should use "guix environment" as already poitend
> out by ison in this thread or...
Guix environment will work for other use cases I have, but not for this one.
Because once I exit an environment the packages I installed there are not kept
around, but I want the packages specified in the manifest to be added to the
user profile. Also, I can't do just "guix environment -m FILE", I have to
provide at least one package as an argument for PACKAGES..., and that would not
make sense in my use case.
> if you are willing to hack a little bit, Ricardo Wurmus wrote a little
> Guile script that helps convert a profile manifest (e.g. your default
> profile) to a manifest.scm file:
>
> http://lists.gnu.org/archive/html/guix-devel/2018-10/msg00023.html
>
That gave me ideas. I looked at the (guix profiles) module and wrote a manifest
like this for testing:
##########
(use-modules (gnu packages)
(guix profiles)
(ice-9 match)
(ice-9 pretty-print))
;;; HELPER PROCEDURES
;;; =================
(define (profile-manifest->package-names)
"Return a list with the names of the packages installed in the user
profile (see %user-profile-directory in the (guix profiles) module)."
(map manifest-entry-name
(manifest-entries (profile-manifest %user-profile-directory))))
;;; PACKAGES
;;; ========
(define packages
(append (profile-manifest->package-names)
(list "alex4"
"endless-sky")))
;;; MANIFEST
;;; ========
(packages->manifest (map specification->package packages))
##########
I think that's what I wanted.
Thanks, Giovanni :)