Subject: Re: [bug#47163] [PATCH] refresh: Add '--installed' option.

From: zimoun <[email-masked]>
Date: Tue, 16 Mar 2021 13:58:44 +0100

Hi Léo,

On Tue, 16 Mar 2021 at 10:18, Léo Le Bouter via Guix-patches via
<[email-masked]> wrote:
> I would also really like such option for 'lint' and 'refresh' that can
> take an operating-system definition so I can ensure a certain set of
> packages are up to some standards and help me focus my efforts on my or
> some fellow's configuration (especially w.r.t. security), rather than
> randomly trying to maintain *everything* in the GNU Guix repo which is
> quite exhausting and large work to take on. Starting from a place of
> actual need for myself and some fellow's configurations looks like a
> more achieveable goal mid-term.

Adding the manifest option to "guix lint", is it not enough?  I do not
know how many packages you have in your operating-system definition
but from my understanding your user-wide packages should be in
manifest.scm files, and you could also maintain a manifest.scm file
for your packages system-wide.  Anyway.

Here an example with an hard-coded path, saved in /tmp/manifest-from-os.scm:

--8<---------------cut here---------------start------------->8---
(use-modules
 (gnu system)
 (guix profiles))

(define os
  (load "/home/simon/src/guix/guix/gnu/system/examples/bare-bones.tmpl"))

(define pkgs (operating-system-packages os))

(packages->manifest pkgs)
--8<---------------cut here---------------end--------------->8---

Then "guix refresh -m /tmp/manifest-from-os.scm" should do the job.
Well, it is an example, the point is simply to show that an option is
not necessary, IMHO.  However, a robust script could be in etc/ with
some other tools and with a line in the manual.  Maybe. :-)
It seems better to keep separated what operates on packages and what
operates on system.

Cheers,
simon