diff mbox series

[bug#65439] maint: Support `guix shell' in Guix's git archive with

Message ID 87y1i48a9g.fsf@gnu.org
State New
Headers show
Series [bug#65439] maint: Support `guix shell' in Guix's git archive with | expand

Commit Message

Janneke Nieuwenhuizen Aug. 21, 2023, 7:29 p.m. UTC
Hi!

A couple of months ago I stumbled upon this awesome-looking guide
<https://rednosehacker.com/combo-guix-shell-emacs-envrc-el> and today I
finally found the time to setup direnv and emacs-envrc with Guix for my
development projects.  Really should have done this sooner, it's a huge
step-up from M-x guix-set-emacs-environment (or in avoiding to do that
run make in the shell and lookup line numbers manually -- why does ffap
not respect GNU-style error messages, btw?).

Most everything worked...except for Guix; as Guix git does not support
`guix shell' ootb; you really need your own local hack or have to type
something like "guix shell -D guix".

In the attached patch I share my local hack `maintenance.scm', which
allows this generalized .envrc

--8<---------------cut here---------------start------------->8---
eval $(guix shell --search-paths)
if test -d doc; then
   export INFOPATH="$PWD/doc${INFOPATH:+:}$INFOPATH"
fi
if test -f pre-inst-env; then
    source pre-inst-env ""
else
    export GUILE_LOAD_PATH="$PWD${GUILE_LOAD_PATH:+:}$GUILE_LOAD_PATH"
    export GUILE_LOAD_COMPILED_PATH="$PWD${GUILE_LOAD_COMPILED_PATH:+:}$GUILE_LOAD_COMPILED_PATH"
fi
--8<---------------cut here---------------end--------------->8---

to also work for Guix.

Greetings,
Janneke
diff mbox series

Patch

From 84bb463a70bacf93e74fe6c0f14932149acd5383 Mon Sep 17 00:00:00 2001
Message-ID: <84bb463a70bacf93e74fe6c0f14932149acd5383.1692646073.git.janneke@gnu.org>
From: Janneke Nieuwenhuizen <janneke@gnu.org>
Date: Mon, 21 Aug 2023 20:57:12 +0200
Subject: [PATCH] maint: Support `guix shell' in Guix's git archive with
 manifest.scm.

* manifest.scm: New file.
* Makefile.am (EXTRA_DIST): Add it.
---
 Makefile.am  |  1 +
 manifest.scm | 32 ++++++++++++++++++++++++++++++++
 2 files changed, 33 insertions(+)
 create mode 100644 manifest.scm

diff --git a/Makefile.am b/Makefile.am
index 738532f839..1237968ddd 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -692,6 +692,7 @@  EXTRA_DIST +=						\
   ROADMAP						\
   TODO							\
   bootstrap						\
+  manifest.scm						\
   build-aux/build-self.scm				\
   build-aux/check-channel-news.scm			\
   build-aux/check-final-inputs-self-contained.scm	\
diff --git a/manifest.scm b/manifest.scm
new file mode 100644
index 0000000000..14473443ed
--- /dev/null
+++ b/manifest.scm
@@ -0,0 +1,32 @@ 
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2022 Janneke Nieuwenhuizen <janneke@gnu.org>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+;; GNU Guix development manifest.  To create development environment, run
+;;
+;;     guix shell
+;;
+;; or something like
+;;
+;;     guix shell --pure git git:send-email openssh
+
+(use-modules (srfi srfi-1)
+             (guix packages)
+             (guix profiles)
+             (gnu packages package-management))
+
+(package->development-manifest guix)

base-commit: 4c7627dfec88350f9a1705e9527c38dd41506f8b
-- 
2.41.0