guix-devel
[Top][All Lists]
Advanced

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

Re: guix environment --profile with --ad-hoc


From: Pierre Neidhardt
Subject: Re: guix environment --profile with --ad-hoc
Date: Sat, 13 Mar 2021 09:55:28 +0100

Hi!

Lars-Dominik Braun <lars@6xq.net> writes:

> hm, I feel that’s unnecessarly complex with lots of if’s and else’s.

Maybe you misunderstood what I'm trying to do.  I'd like to avoid shell
code just to check if the profile root exists before deciding which Guix
command to run.

In other words, I'd like a exexv'able command instead of having to wrap
if with some shell code.

Currently from Emacs, if I must use `call-process` to switch to the environment,
then I must wrap if with some shell code, e.g.

--8<---------------cut here---------------start------------->8---
(call-process
  "guix" nil nil nil
  "bash" "-c"
  "if [ -f ... ]; then
     guix environment --profile=...
   else
     guix environment --root=...
   fi")
--8<---------------cut here---------------end--------------->8---

which is more cumbersome and requires brittle shell-escapes compared to

--8<---------------cut here---------------start------------->8---
(call-process
  "guix" nil nil nil
  "environment" "--profile=..." ...)
--8<---------------cut here---------------end--------------->8---

Does that make sense?

Cheers!

-- 
Pierre Neidhardt
https://ambrevar.xyz/

Attachment: signature.asc
Description: PGP signature


reply via email to

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