[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: nix shellHook equivalent for guix environment?
From: |
Xinglu Chen |
Subject: |
Re: nix shellHook equivalent for guix environment? |
Date: |
Wed, 10 Mar 2021 16:03:14 +0100 |
Hi!
On Tue, Mar 09 2021, Pierre-Antoine Bouttier wrote:
> Dear all,
>
> Do you know if there is any equivalent to shellHook, available for the
> nix-shell command, for setting up a guix environment through a
> manifest.scm file?
>
> Or maybe another methodology with guix to have approximatively the
> same behavior? (i.e. in a file that can be put under version control,
> defining dependancies and also init commands to set up a guix
> environment)
I am not aware of a guix environment equivalent to shellHook, but I
suggest you checking out direnv[1]. It allows you to setup an
environment on a per-directory basis, everytime you enter a directory
the content of the `.envrc` file will be run in your shell.
There is also integration with Guix[2] so you could have an `.envrc`
file like this:
--8<---------------cut here---------------start------------->8---
use_guix <some-package> --ad-hoc git -L manifest.scm
echo "Environment created!"
[...]
--8<---------------cut here---------------end--------------->8---
[1] https://direnv.net/
[2] https://github.com/direnv/direnv/wiki/GNU-Guix
--
Xinglu Chen