help-guix
[Top][All Lists]
Advanced

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

Re: How do I install packages from a file without removing currently ins


From: Pierre Neidhardt
Subject: Re: How do I install packages from a file without removing currently installed packages?
Date: Sat, 11 May 2019 10:55:23 +0200

Improved manifest generator (https://ambrevar.xyz/guix-advance/index.html):

--8<---------------cut here---------------start------------->8---
(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.")))
--8<---------------cut here---------------end--------------->8---

This includes the package outputs, sort everything and includes the Guix commit.

Cheers!

-- 
Pierre Neidhardt
https://ambrevar.xyz/

Attachment: signature.asc
Description: PGP signature


reply via email to

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