summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2022-09-23 18:19:53 -0400
committerDavid Thompson <dthompson2@worcester.edu>2022-09-23 18:19:53 -0400
commit044259e9319e5d130ec5c5e748c631b73a693d2b (patch)
tree42e444703c0ba015f4050c4d0769a10a949afe3c
parent88882f96c8dfb8a4d6f72095689c5de91c559d9d (diff)
Update guix-for-dev post.
-rw-r--r--posts/2022-09-23-guix-for-dev.md20
1 files changed, 14 insertions, 6 deletions
diff --git a/posts/2022-09-23-guix-for-dev.md b/posts/2022-09-23-guix-for-dev.md
index 3f92c62..a255be6 100644
--- a/posts/2022-09-23-guix-for-dev.md
+++ b/posts/2022-09-23-guix-for-dev.md
@@ -160,12 +160,20 @@ host system is inaccessible. I rarely use either flag.
`guix shell` runs pretty fast after it downloads all the required
software the first time, and it can be run non-interactively, so it's
-pretty handy to use in scripts. I like to use it with Emacs'
-compilation feature. I run `M-x compile` and use `guix shell -D -f
-guix.scm -- make` as the compilation command to run `make` in the
-proper context. When running `guix shell` non-interactively, it must
-be made explicit that `guix.scm` should be loaded (a minor usability
-issue, IMO.)
+pretty handy to use in scripts. It can even be used with
+[direnv](https://direnv.net/) by adding this to `.envrc`:
+
+```
+eval $(guix shell --search-paths)
+```
+
+I'm an Emacs user, so I want to integrate `guix shell` there, as well.
+Turns out that's pretty easy via the
+[emacs-direnv](https://github.com/wbolster/emacs-direnv) extension.
+With `direnv-mode` enabled, I can run `M-x compile`, enter `make` as
+the compilation command, and build my project from within Emacs using
+the environment built by `guix shell`. Pretty fancy! Thanks to
+Andrew Whatson for teaching me about this.
The same `guix.scm` file can be used with more than just `guix shell`.
For example, `guix build -f guix.scm` will build the project from