unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: zimoun <zimon.toutoune@gmail.com>
To: Phil <phil@beadling.co.uk>
Cc: help-guix <help-guix@gnu.org>
Subject: Re: guix pull only from private channel
Date: Wed, 16 Dec 2020 15:07:49 +0100	[thread overview]
Message-ID: <CAJ3okZ09urm3X2LhkGBXC83iCrTq-j-t+j-=mjYCAzY5SZvxkw@mail.gmail.com> (raw)
In-Reply-To: <85czzbx878.fsf@beadling.co.uk>

Hi,

On Tue, 15 Dec 2020 at 19:29, Phil <phil@beadling.co.uk> wrote:

> 1) If the private channel is a git repo accessed via ssh it seems
> necessary to add the ssh key to an ssh-agent rather than have it pick up
> ~/.ssh/id_rsa.  This isn't a huge problem but when the ssh key has no
> passphrase the use of an agent is actually more complicated than passing
> the key directly?  Is it possible to specify a key file, and if not, is
> there any good reason why not (I thought perhaps it might be access via
> the guix-daemon or similar at a wild guess)?

About this, I do not know.

> 2) Assuming I use an ssh-agent to avoid issue in 1), if I want to only
> pull updates from my private channel and not from the Guix channel, I
> find myself doing something like the below to force Guix channel to stay constant:
>
> eval `ssh-agent` && ssh-add && guix pull --commit=$(guix describe -f
> json | jq -r '.[] | select(.name=="guix").commit') && guix upgrade my-package-name
>
> This works, but it feels rather ugly - is there an easier way of saying
> "hold guix constant, but pull in latest updates from my private
> channel" - it feels like a common use-case to me?

About this, you should write a specific channels.scm file and then run:

  guix pull -C channels.scm

where the file is for example:

--8<---------------cut here---------------start------------->8---
(use-modules
 (guix utils)
 (guix profiles)
 (guix channels)
 (guix openpgp))

(define guix (car %default-channels))
(define current (string-append (config-directory #:ensure? #f) "/current"))
(define channels (profile-channels current))
(define defaults (filter (lambda (channel)
                          (define (channel=? channel1 channel2)
                            (equal?
                             (channel-name channel1)
                             (channel-name channel2)))
                          (channel=? channel guix))
                        channels))

(append
 defaults
 (list
  (channel
  (name 'past)
  (url "https://gitlab.inria.fr/guix-hpc/guix-past.git")
  (branch "master"))))
--8<---------------cut here---------------end--------------->8---

Obviously, this is a quick example and you could filter as you
want--here only with the channel name "guix".  And this file could be
in '~/.config/guix/channels.scm' and so "guix pull" would only pull
everything except the channel named 'guix' which stays constant.  Then
to update the current 'guix' channel, you could have another file, for
instance ~/.config/guix/default-channels.scm containing only one line
with "%default-channels" and so "guix pull -C
~/.config/guix/default-channels.scm" would only update the default
ones.

The point is: instead of this ugly command line with ugly filtering,
you should investigate in the Scheme API. :-)

Hope that helps,
simon


  reply	other threads:[~2020-12-16 14:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-15 17:58 guix pull only from private channel Phil
2020-12-16 14:07 ` zimoun [this message]
2020-12-19 12:28   ` Phil
2020-12-21 12:16     ` zimoun
2020-12-22  9:27       ` Phil
2020-12-22 11:44         ` zimoun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJ3okZ09urm3X2LhkGBXC83iCrTq-j-t+j-=mjYCAzY5SZvxkw@mail.gmail.com' \
    --to=zimon.toutoune@gmail.com \
    --cc=help-guix@gnu.org \
    --cc=phil@beadling.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).