guix-devel
[Top][All Lists]
Advanced

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

Re: Some emacs stuff to activate/deactivate guix profiles


From: zimoun
Subject: Re: Some emacs stuff to activate/deactivate guix profiles
Date: Thu, 17 Dec 2020 09:26:11 +0100

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 via email to

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