[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Some general guix questions

From: Ricardo Wurmus
Subject: Re: Some general guix questions
Date: Tue, 08 Jan 2019 21:36:42 +0100
User-agent: mu4e 1.0; emacs 26.1

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
>  '(
>       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)
      ',(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 > 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]