Ludovic Courtès writes: >> Same thing, what I had in mind was to store the version number in the >> _serialized_ specifications.scm, as for the manifest. >> >> This way I believe we can support multiple version for specifications.scm. >> Am I missing something? > > Then I don’t get how ‘specifications.scm’ would differ from ‘manifest’. > In both cases we’re talking about a serialization format containing > per-package provenance info, right? The main differences: - specifications.scm is a good fit to the --manifest argument. - specifications.scm is human-editable because it does not contain fields like the store path. >> Yes, so I'll try to sum up what I want to achieve in one sentence: >> "automate the textual serialization of profile specifications to >> simplify their backup/deployment/reproduction". > > OK. > > To me, serialization is already automated: it’s the ‘manifest’ file. > > What we lack is the ability to obtain a “manifest.scm” kind of file > (code) that users can pick as a starting point in their migration > towards declarative deployment. You mean a script like the following? --8<---------------cut here---------------start------------->8--- ;; Run with: ;; guile -s FILE ~/.guix-profile (use-modules (guix profiles) (gnu packages) ; fold-packages (guix packages) ; package structure (ice-9 match) (ice-9 pretty-print)) (define (packages-by-name name) (fold-packages (lambda (package list) (if (string=? (package-name package) name) (cons package list) list)) '())) (define (guix-manifest where) (sort (map (lambda (entry) (let* ((name (manifest-entry-name entry)) (out (manifest-entry-output entry)) (version (manifest-entry-version entry)) (default-version (match (packages-by-name name) ((first-name . rest) (package-version first-name)) (else #f)))) (string-append name (if (and default-version (not (string= version default-version))) (format #f "@~a" version) "") (if (string= out "out") "" (format #f ":~a" out))))) (manifest-entries (profile-manifest where))) stringmanifest ',(guix-manifest where)))) (_ (error "Please provide the path to a Guix profile."))) --8<---------------cut here---------------end--------------->8--- -- Pierre Neidhardt https://ambrevar.xyz/