all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How do I install packages from a file without removing currently installed packages?
@ 2019-05-10 15:59 sirgazil
  2019-05-10 17:42 ` swedebugia
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: sirgazil @ 2019-05-10 15:59 UTC (permalink / raw)
  To: help-guix

Hi,

I see that there is "guix package --manifest FILE", but running this command will create a generation with only those packages specified in FILE. Packages installed previous to running this command are removed. 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?


---
https://sirgazil.bitbucket.io/

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

* Re: How do I install packages from a file without removing currently installed packages?
  2019-05-10 15:59 How do I install packages from a file without removing currently installed packages? sirgazil
@ 2019-05-10 17:42 ` swedebugia
  2019-05-10 21:35   ` sirgazil
  2019-05-10 20:49 ` ison
  2019-05-11  8:30 ` Giovanni Biscuolo
  2 siblings, 1 reply; 8+ messages in thread
From: swedebugia @ 2019-05-10 17:42 UTC (permalink / raw)
  To: sirgazil, help-guix

[-- Attachment #1: Type: text/plain, Size: 589 bytes --]

On 2019-05-10 17:59, sirgazil wrote:
> Hi,
> 
> I see that there is "guix package --manifest FILE", but running this command will create a generation with only those packages specified in FILE. Packages installed previous to running this command are removed. 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?

Not to my knowledge. This is by design.

Choose either when managing your profile or use different profiles perhaps.

-- 
Cheers Swedebugia


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

* Re: How do I install packages from a file without removing currently installed packages?
  2019-05-10 15:59 How do I install packages from a file without removing currently installed packages? sirgazil
  2019-05-10 17:42 ` swedebugia
@ 2019-05-10 20:49 ` ison
  2019-05-10 21:29   ` sirgazil
  2019-05-11  8:30 ` Giovanni Biscuolo
  2 siblings, 1 reply; 8+ messages in thread
From: ison @ 2019-05-10 20:49 UTC (permalink / raw)
  To: sirgazil; +Cc: help-guix

This may not be exactly what you were looking for, but I think "guix environment" might behave sort of like that. It can also accept a manifest file, of course the environment will only be temporary but, if I'm not mistaken, it should combine with your current environment.

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

* Re: How do I install packages from a file without removing currently installed packages?
  2019-05-10 20:49 ` ison
@ 2019-05-10 21:29   ` sirgazil
  0 siblings, 0 replies; 8+ messages in thread
From: sirgazil @ 2019-05-10 21:29 UTC (permalink / raw)
  To: ison; +Cc: help-guix

---- On Fri, 10 May 2019 15:49:17 -0500 ison <ison@airmail.cc> wrote ----

 > This may not be exactly what you were looking for, but I think "guix environment" might behave sort of like that. It can also accept a manifest file, of course the environment will only be temporary but, if I'm not mistaken, it should combine with your current environment. 
 > 

Yeah, I tried "guix environment -m PACKAGE..." before, but it is not quite what I'm looking for. I was hoping to find some option with "guix package" for non-programming projects that don't really need environments.

Thanks, ison :)

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

* Re: How do I install packages from a file without removing currently installed packages?
  2019-05-10 17:42 ` swedebugia
@ 2019-05-10 21:35   ` sirgazil
  0 siblings, 0 replies; 8+ messages in thread
From: sirgazil @ 2019-05-10 21:35 UTC (permalink / raw)
  To: swedebugia; +Cc: help-guix

---- On Fri, 10 May 2019 12:40:10 -0500 swedebugia <swedebugia@riseup.net> wrote ----

 > On 2019-05-10 17:59, sirgazil wrote: 
 > > Hi, 
 > > 
 > > I see that there is "guix package --manifest FILE", but running this command will create a generation with only those packages specified in FILE. Packages installed previous to running this command are removed. 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? 
 >  
 > Not to my knowledge. This is by design. 
 >  
 > Choose either when managing your profile or use different profiles perhaps. 

Sounds complicated, but could you point me to the manual section(s) that talk about this? I don't see much general information about manipulating profiles in the manual (I'm using the Concept index).

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

* Re: How do I install packages from a file without removing currently installed packages?
  2019-05-10 15:59 How do I install packages from a file without removing currently installed packages? sirgazil
  2019-05-10 17:42 ` swedebugia
  2019-05-10 20:49 ` ison
@ 2019-05-11  8:30 ` Giovanni Biscuolo
  2019-05-11  8:55   ` Pierre Neidhardt
  2019-05-11 15:55   ` sirgazil
  2 siblings, 2 replies; 8+ messages in thread
From: Giovanni Biscuolo @ 2019-05-11  8:30 UTC (permalink / raw)
  To: sirgazil, help-guix

[-- Attachment #1: Type: text/plain, Size: 2098 bytes --]

Hello sirgazil,

sirgazil <sirgazil@zoho.com> 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...

you could "manually" list packages installed in your preferred
(default?) profile to a manifest or...

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

quoting here an excerpt for completeness (since the original message was
on guix-devel):

> --8<---------------cut here---------------start------------->8---
> (use-modules (guix profiles)
>              (ice-9 match)
>              (ice-9 pretty-print))
> 
> (match (command-line)
>   ((_ where)
>    (pretty-print
>     `(specifications->manifest
>       ',(map manifest-entry-name (manifest-entries (profile-manifest where))))))
>   (_ (error "Please provide the path to a Guix profile.")))
> --8<---------------cut here---------------end--------------->8---
> 
> You can put this in a file “manifest-to-manifest.scm” and run it like
> this from a Guix source checkout:
> 
>     ./pre-inst-env guile -s manifest-to-manifest.scm /path/to/.guix-profile > 
> my-manifest.scm
> 
> You can then proceed to install the generated manifest with:
> 
>     guix package -m my-manifest.scm -p /path/to/new/.guix-profile

e.g. you can convert your current default profile manifest with:

 ./pre-inst-env guile -s manifest-to-manifest.scm $HOME/.guix-profile > default-manifest.scm
  
hint: if you look at $HOME/.guix-profile/manifest you'll see what's
installed in your default profile... *provenance* included :-)

HTH! Gio'

-- 
Giovanni Biscuolo

Xelera IT Infrastructures

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

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

* Re: How do I install packages from a file without removing currently installed packages?
  2019-05-11  8:30 ` Giovanni Biscuolo
@ 2019-05-11  8:55   ` Pierre Neidhardt
  2019-05-11 15:55   ` sirgazil
  1 sibling, 0 replies; 8+ messages in thread
From: Pierre Neidhardt @ 2019-05-11  8:55 UTC (permalink / raw)
  To: Giovanni Biscuolo, sirgazil, help-guix

[-- Attachment #1: Type: text/plain, Size: 1400 bytes --]

Improved manifest generator (https://ambrevar.xyz/guix-advance/index.html):

--8<---------------cut here---------------start------------->8---
(use-modules (guix profiles)
	     (ice-9 match)
	     (ice-9 pretty-print))

(define (guix-manifest where)
  (sort (map (lambda (entry)
		     (let ((out (manifest-entry-output entry)))
		       (if (string= out "out")
			   (manifest-entry-name entry)
			   (format #f "~a:~a"
				   (manifest-entry-name entry)
				   (manifest-entry-output entry)))))
		   (manifest-entries (profile-manifest where)))
	string<?))

;; Thanks to Ivan Vilata-i-Balaguer for this:
(define (guix-commit)
  (let ((guix-manifest (profile-manifest (string-append (getenv "HOME") "/.config/guix/current"))))
    (match (assq 'source (manifest-entry-properties (car (manifest-entries guix-manifest))))
      (('source ('repository ('version 0) _ _
			     ('commit commit) _ ...))
       commit)
      (_ #f))))

(match (command-line)
  ((_ where)
   (format #t ";; commit: ~a\n" (guix-commit))
   (pretty-print
    `(specifications->manifest
      ',(guix-manifest where))))
  (_ (error "Please provide the path to a Guix profile.")))
--8<---------------cut here---------------end--------------->8---

This includes the package outputs, sort everything and includes the Guix commit.

Cheers!

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

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

* Re: How do I install packages from a file without removing currently installed packages?
  2019-05-11  8:30 ` Giovanni Biscuolo
  2019-05-11  8:55   ` Pierre Neidhardt
@ 2019-05-11 15:55   ` sirgazil
  1 sibling, 0 replies; 8+ messages in thread
From: sirgazil @ 2019-05-11 15:55 UTC (permalink / raw)
  To: Giovanni Biscuolo; +Cc: help-guix

Hi Giovanni,


---- On Sat, 11 May 2019 03:30:34 -0500 Giovanni Biscuolo <g@xelera.eu> wrote ----

 > Hello sirgazil, 
 >  
 > sirgazil <sirgazil@zoho.com> 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 :)

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

end of thread, other threads:[~2019-05-11 16:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-10 15:59 How do I install packages from a file without removing currently installed packages? sirgazil
2019-05-10 17:42 ` swedebugia
2019-05-10 21:35   ` sirgazil
2019-05-10 20:49 ` ison
2019-05-10 21:29   ` sirgazil
2019-05-11  8:30 ` Giovanni Biscuolo
2019-05-11  8:55   ` Pierre Neidhardt
2019-05-11 15:55   ` sirgazil

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.