unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: zimoun <zimon.toutoune@gmail.com>
To: pinoaffe <pinoaffe@gmail.com>, guix-devel@gnu.org
Subject: Re: Some emacs stuff to activate/deactivate guix profiles
Date: Thu, 17 Dec 2020 09:26:11 +0100	[thread overview]
Message-ID: <86h7okon30.fsf@gmail.com> (raw)
In-Reply-To: <877dphyqn2.fsf@gmail.com>

Hi,

On Thu, 17 Dec 2020 at 05:59, pinoaffe <pinoaffe@gmail.com> wrote:

> I've attached the reusable stuff in guix-profiles.el, and my personal
> config in init-profiles.el.

Thanks for sharing.

> (defun guix-profiles->environment-vars (profiles)
>   (shell-command-to-string
>    (string-join (apply #'list
>                        "guix"
>                        "package"
>                        "--search-paths"

Instead of call shell command and then…

> (defun guix-path-file->key-value (str)
>   (mapcar (lambda (line)
>               (let* ((lst (split-string line "="))
>                      (var (string-remove-prefix "export " (car lst)))
>                      (val (string-trim (string-join (cdr lst) "=") "\"" "\"")))
>                 (cons var val)))
>           (split-string (string-trim-right str "\n")
>                         "\n")))

…parse the output, you should give a look at how Emacs-Guix does using
the Scheme API.  Or maybe use “guix repl” as Nyxt does.


Aside, it is a bit redundant with Emacs-Guix, from my understanding. :-)

All the best,
simon


  reply	other threads:[~2020-12-17  8:27 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-17  4:59 Some emacs stuff to activate/deactivate guix profiles pinoaffe
2020-12-17  8:26 ` zimoun [this message]
2020-12-17  8:36   ` pinoaffe
2020-12-17  8:52     ` zimoun
2020-12-17  8:31 ` pinoaffe
  -- strict thread matches above, loose matches on Subject: below --
2020-12-17  8:29 pinoaffe
2020-12-17  9:32 ` Jan Nieuwenhuizen
2020-12-17 14:28   ` pinoaffe
2020-12-17  4:57 pinoaffe
2020-12-16 19:43 pinoaffe
2020-12-16 19:43 pinoaffe

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=86h7okon30.fsf@gmail.com \
    --to=zimon.toutoune@gmail.com \
    --cc=guix-devel@gnu.org \
    --cc=pinoaffe@gmail.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

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).