Hi Pierre,

>    My personal take at this issue is to generate the manifest from all 
> installed
>    packages with the following shell script:
>
> --8<---------------cut here---------------start------------->8---
>       cat<<EOF>"$PKG_ROOT/guix"
> (specifications->manifest
>  '(
> EOF
>
>       guix package -I | awk '{printf("\"%s", $1); if($3!="out") {printf("%s", 
> ":" $3)}; print "\""}' | LC_ALL=C sort >>"$PKG_ROOT/guix"
>       echo "))" >>"$PKG_ROOT/guix"
> --8<---------------cut here---------------end--------------->8---
>
>   There might be better ways to do this.

Not sure if better (because it has the same effect), but here’s a
different way to get a “manifest” from the list of installed packages.

--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

--
Ricardo


Reply via email to