all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* A question about manifest for my profile
       [not found] <1550644224.410841277.1563289658540.JavaMail.root@zimbra49-e8.priv.proxad.net>
@ 2019-07-16 15:16 ` hub.lombard
  2019-07-17 13:14   ` 宋文武
  0 siblings, 1 reply; 3+ messages in thread
From: hub.lombard @ 2019-07-16 15:16 UTC (permalink / raw)
  To: Help Guix

Hi Guix!

I generated a 'manifest-to-manifest.scm' manifest of all the packages installed in my user profile, using this Guile script (I can not find the address anymore)

----------------------------------------------------------------------------------------------------
;; Run with:
;;     guile -s FILE ~/.guix-profile

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

Then I called it:

hubert@gnu ~$ guile -s manifest-to-manifest.scm ~/.guix-profile
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;;       or pass the --no-auto-compile argument to disable.
;;; compiling /home/hubert/manifest-to-manifest.scm
;;; compiled /home/hubert/.cache/guile/ccache/2.2-LE-8-3.A/home/hubert/manifest-to-manifest.scm.go
;; commit: 6c83c48391ebc2b08ca4704c437de4f1e59fca9a
(specifications->manifest
  '("brasero"
    "ffmpeg"
    "gimp"
    "gnumeric"
    "inkscape"
    "lynx"
    "markdown"
    "mpv"
    "obs"
    "qemu"
    "quassel"
    "racket"
    "sbcl-next"
    "ungoogled-chromium"
    "wget"
    "youtube-dl"
    "youtube-viewer"))
hubert@gnu ~$

Then I made the updates, reconfigured /etc/config.scm and restarted.

I think the launch of the script was more or less equivalent to the following command:

$ guix package --manifest=manifest-to-manifest.scm

In which case, I will not need to run this command?

And finally, are there any changes to make in '/etc/config.scm'? Maybe add to it:

-----------------------------------------------
(specifications->manifest
  '("brasero"
    "ffmpeg"
    "gimp"
    "gnumeric"
    "inkscape"
    "lynx"
    "markdown"
    "mpv"
    "obs"
    "qemu"
    "quassel"
    "racket"
    "ungoogled-chromium"
    "wget"
    "youtube-dl"
    "youtube-viewer"))
-----------------------------------------------

Thank you in advance for your possible clarification :-)

Hubert

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

* Re: A question about manifest for my profile
  2019-07-16 15:16 ` A question about manifest for my profile hub.lombard
@ 2019-07-17 13:14   ` 宋文武
  2019-07-20 19:35     ` hub.lombard
  0 siblings, 1 reply; 3+ messages in thread
From: 宋文武 @ 2019-07-17 13:14 UTC (permalink / raw)
  To: hub.lombard; +Cc: Help Guix

hub.lombard@free.fr writes:

> Hi Guix!
>
> I generated a 'manifest-to-manifest.scm' manifest of all the packages installed in my user profile, using this Guile script (I can not find the address anymore)
>
> ----------------------------------------------------------------------------------------------------
> ;; Run with:
> ;;     guile -s FILE ~/.guix-profile
>
> (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.")))
> ----------------------------------------------------------------------------------------------------
>
> Then I called it:
>
> hubert@gnu ~$ guile -s manifest-to-manifest.scm ~/.guix-profile
> ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
> ;;;       or pass the --no-auto-compile argument to disable.
> ;;; compiling /home/hubert/manifest-to-manifest.scm
> ;;; compiled /home/hubert/.cache/guile/ccache/2.2-LE-8-3.A/home/hubert/manifest-to-manifest.scm.go
> ;; commit: 6c83c48391ebc2b08ca4704c437de4f1e59fca9a
> (specifications->manifest
>   '("brasero"
>     "ffmpeg"
>     "gimp"
>     "gnumeric"
>     "inkscape"
>     "lynx"
>     "markdown"
>     "mpv"
>     "obs"
>     "qemu"
>     "quassel"
>     "racket"
>     "sbcl-next"
>     "ungoogled-chromium"
>     "wget"
>     "youtube-dl"
>     "youtube-viewer"))
> hubert@gnu ~$
>
> Then I made the updates, reconfigured /etc/config.scm and restarted.
>
> I think the launch of the script was more or less equivalent to the following command:
>
> $ guix package --manifest=manifest-to-manifest.scm

This '--manifest' option accept a file, which should return a manifest
object, and the script you run generate it from your profile.  So you
can write the script output "(specifications->manifest .....)" into a
file, eg: "~/.config/guix/manifest.scm", then use "guix package -m
~/.config/guix-manifest.scm" to apply it.


>
> In which case, I will not need to run this command?
>
> And finally, are there any changes to make in '/etc/config.scm'? Maybe add to it:
>
> -----------------------------------------------
> (specifications->manifest
>   '("brasero"
>     "ffmpeg"
>     "gimp"
>     "gnumeric"
>     "inkscape"
>     "lynx"
>     "markdown"
>     "mpv"
>     "obs"
>     "qemu"
>     "quassel"
>     "racket"
>     "ungoogled-chromium"
>     "wget"
>     "youtube-dl"
>     "youtube-viewer"))
> -----------------------------------------------


No, the "packages" field of "operation-system" accept a list of package
objects, it can't deal with "manifest".  In fact, "manifest" is used to
manage user's own profile, in a declarative way, just like "packages".

>
> Thank you in advance for your possible clarification :-)

Yeah, hope it helps!

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

* Re: A question about manifest for my profile
  2019-07-17 13:14   ` 宋文武
@ 2019-07-20 19:35     ` hub.lombard
  0 siblings, 0 replies; 3+ messages in thread
From: hub.lombard @ 2019-07-20 19:35 UTC (permalink / raw)
  To: 宋文武; +Cc: Help Guix

----- Mail original -----
De: "宋文武" <iyzsong@member.fsf.org>
À: "hub lombard" <hub.lombard@free.fr>
Cc: "Help Guix" <help-guix@gnu.org>
Envoyé: Mercredi 17 Juillet 2019 15:14:38
Objet: Re: A question about manifest for my profile

hub.lombard@free.fr writes:

>> Hi Guix!
>> I generated a 'manifest-to-manifest.scm' manifest of all the packages installed in my user profile
>> Then I called it:
>> hubert@gnu ~$ guile -s manifest-to-manifest.scm ~/.guix-profile


>> Then I made the updates, reconfigured /etc/config.scm and restarted.

>> I think the launch of the script was more or less equivalent to the following command:

>> $ guix package --manifest=manifest-to-manifest.scm

>This '--manifest' option accept a file, which should return a manifest
>object, and the script you run generate it from your profile.  So you
>can write the script output "(specifications->manifest .....)" into a
>file, eg: "~/.config/guix/manifest.scm", then use "guix package -m
>~/.config/guix-manifest.scm" to apply it.

Done!... By launching:

$ guix package -m ~/.config/guix/manifest.scm

>
>> In which case, I will not need to run this command?
>
>> And finally, are there any changes to make in '/etc/config.scm'? Maybe add to it:
>
>> -----------------------------------------------
>> (specifications->manifest
>>   '("brasero"
>>     "ffmpeg"
>>     "gimp"
>>     "gnumeric"
>>     "inkscape"
>>     "lynx"
>>     "markdown"
>>     "mpv"
>>     "obs"
>>     "qemu"
>>     "quassel"
>>     "racket"
>>     "ungoogled-chromium"
>>     "wget"
>>     "youtube-dl"
>>     "youtube-viewer"))
>> -----------------------------------------------


>No, the "packages" field of "operation-system" accept a list of package
>objects, it can't deal with "manifest".  In fact, "manifest" is used to
>manage user's own profile, in a declarative way, just like "packages".

Got it...


>> Thank you in advance for your possible clarification :-)

>Yeah, hope it helps!

Indeed :) Thank you so much iyzsong!

Hubert

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

end of thread, other threads:[~2019-07-20 19:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1550644224.410841277.1563289658540.JavaMail.root@zimbra49-e8.priv.proxad.net>
2019-07-16 15:16 ` A question about manifest for my profile hub.lombard
2019-07-17 13:14   ` 宋文武
2019-07-20 19:35     ` hub.lombard

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.