hub.lomb...@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!