help-guix
[Top][All Lists]
Advanced

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

Re: Guix and Emacs Integration for Polyglot Development


From: George Clemmer
Subject: Re: Guix and Emacs Integration for Polyglot Development
Date: Mon, 10 Sep 2018 21:10:39 -0400
User-agent: mu4e 1.0; emacs 26.1

Kenny Ballou <address@hidden> writes:

> I would like to be able to specify a project's dependencies in a
> manifest file, add any environment variables as necessary, and have
> Emacs be aware of those variables when entering that environment.

Hi Kenny,

I have experimented with various schemes for managing projects in
guix. I have tried 'guix environment', 'guix package', and 'guix system
vm'. FWIW, I have ended up "running" projects with an script that
includes ...

GCP_ROOT=$gcp_root guix package \
        --profile=$gcp_root/.guix-profile \
        -m $gcp_root/.manifest.scm

eval $(guix package -p /var/guix/profiles/system/profile \
        -p $gcp_root/.guix-profile --search-paths=exact)

... where $gcp_root is the project directory.  This effectively replaces
the "default user profile" with a "custom project profile"
($gcp_root/.guix-profile). I put the emacs project config in
$gcp_root/.emacs and run emacs with a script that includes ...

$GCP_ROOT/.guix-profile/bin/emacs \
    --no-site-file \
    --eval='(let ((guix-env (concat (getenv "GCP_ROOT") "/.guix-profile"))) 
(when (and guix-env (require (quote guix-emacs) nil t)) 
(guix-emacs-autoload-packages guix-env)))' \
    --no-init-file \
    --eval='(setq user-emacs-directory (concat (getenv "GCP_ROOT") 
"/.emacs.d/"))' \
    --eval='(load (concat (getenv "GCP_ROOT") "/.emacs"))' \
    --debug-init \
    "$@"

The net effect: a custom emacs config running in a custom profile for
each project. I use Makefiles to maintain $gcp_root/.manifest.scm,
$gcp_root/.emacs, etc. and GNU screen to run/juggle these projects.

HTH - George



reply via email to

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