all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: iyzsong@member.fsf.org (宋文武)
To: hub.lombard@free.fr
Cc: Help Guix <help-guix@gnu.org>
Subject: Re: A question about manifest for my profile
Date: Wed, 17 Jul 2019 21:14:38 +0800	[thread overview]
Message-ID: <87a7dcdcqp.fsf@member.fsf.org> (raw)
In-Reply-To: <186463382.410957592.1563290168079.JavaMail.root@zimbra49-e8.priv.proxad.net> (hub lombard's message of "Tue, 16 Jul 2019 17:16:08 +0200 (CEST)")

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!

  reply	other threads:[~2019-07-18 11:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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   ` 宋文武 [this message]
2019-07-20 19:35     ` hub.lombard

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

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

  git send-email \
    --in-reply-to=87a7dcdcqp.fsf@member.fsf.org \
    --to=iyzsong@member.fsf.org \
    --cc=help-guix@gnu.org \
    --cc=hub.lombard@free.fr \
    /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 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.