Re: [PATCH] Add wrapper scripts to run make in a Nix shell

Demi Marie Obenour
2025-08-08T18:30:15Z

[-- Attachment #1.1.1: Type: text/plain, Size: 1336 bytes --]

On 8/8/25 14:02, Alyssa Ross wrote:
> Demi Marie Obenour <demiobenour@gmail.com> writes:
>
>> On 8/8/25 11:00, Alyssa Ross wrote:
>>> Demi Marie Obenour <demiobenour@gmail.com> writes:
>>>
>>>> It is very easy to forget to do this, and the results are confusing at
>>>> best and wrong at worst. Add wrapper scripts that get it right and also
>>>> automatically change to the correct directory for you.
>>>
>>> I think you'd probably be better setting up nix-direnv or something. It
>>> makes it so that you can't forget to be in the shell, but also means you
>>> can just run make, rather than having to remember to run some other
>>> script. It also comes with caching I think, so if that works you'll
>>> probably save quite a bit of time over doing a Nix evaluation for every
>>> make invocation.
>>
>> For general development I agree, but unless nix-direnv always rebuilds
>> when needed I think wrappers like this might be better for scripted use.
>> The big advantage is that they guarantee the environment variables
>> passed to 'make' will always be up-to-date, and I'm not sure how to
>> achieve that in a script otherwise.
>
> I think that's exactly what it does, but do correct me if I'm wrong.

Is there a way to use nix-direnv from a script?
--
Sincerely,
Demi Marie Obenour (she/her/hers)

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 7253 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]