From: zimoun <zimon.toutoune@gmail.com>
To: Peter Polidoro <peter@polidoro.io>, "(" <paren@disroot.org>
Cc: help-guix@gnu.org
Subject: Re: Using Makefile to run guix shell?
Date: Thu, 08 Dec 2022 11:44:05 +0100 [thread overview]
Message-ID: <86ilimgop6.fsf@gmail.com> (raw)
In-Reply-To: <87edtbdpmo.fsf@polidoro.io>
Hi,
On Wed, 07 Dec 2022 at 13:27, Peter Polidoro <peter@polidoro.io> wrote:
>> Why not just do:
>>
>> guix shell -- make metadata
>
> I do like the idea of not making it depend on guix.
[...]
> I guess I am just curious how other people manage such long
> commands?
Quoting [1],
I have a “general” script
(named guixify) under ~/.local/bin/ which roughly reads:
--8<---------------cut here---------------start------------->8---
#!/bin/sh
guix time-machine -C channels.scm \
-- shell --pure \
-m manifest.scm \
-- $@
--8<---------------cut here---------------end--------------->8---
where manifest.scm and channels.scm are kept with the Git project. I
prefer to pin a specific Guix revision to avoid bad surprises. :-) Well,
in a project, I just run:
guixify make # run make using the Guix environment
guixify # enter in the environment
Well and if I need a more complex command-line invocation specific to
the project, I have Shell scripts with the Git project; for instance
guix-serial-shell.sh
--8<---------------cut here---------------start------------->8---
#!/bin/sh
guix time-machine -C guix/channels.scm \
-- shell -m guix/manifest.scm \
--container --expose=$(PORT) picocom \
-- $@
--8<---------------cut here---------------end--------------->8---
where I try to decouple what requires Guix and what not. Well, I have
not tried, but the idea is then to run:
$ guix-serial-shell.sh make serial-shell
where the Makefile contains the rule:
serial-shell:
picocom -b 9600 -f n -y n -d 8 -p 1 -c $(PORT)
(well, adapting for PORT :-))
Other said, in general, I have a Git repository which looks like
.
├── COPYING
├── guix
│ ├── channels.scm
│ ├── extra
│ │ └── packages.scm
│ ├── manifest.scm
│ ├── other-script.sh
│ └── serial-shell.sh
├── Makefile
├── README
├── src
│ └── code
└── tests
└── stuff
And the guixify scripts from above contains guix/manifest.scm and
guix/channels.scm instead. :-)
Well, I try to keep Makefile working without Guix. And usually, the
folder guix/extra contains some packages that I use via --load-path, for
instance, guix-serial-shell.sh would have:
guix time-machine -C channels.scm \
-- shell -m manifest.scm \
--load-path guix/extra \
--container --expose=$(PORT) picocom \
-- $@
1: https://yhetil.org/guix/86wn9puqj7.fsf@gmail.com
HTH
simon
next prev parent reply other threads:[~2022-12-08 10:53 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-07 14:47 Using Makefile to run guix shell? Peter Polidoro
2022-12-07 15:12 ` (
2022-12-07 15:26 ` Peter Polidoro
2022-12-07 15:38 ` (
2022-12-07 18:27 ` Peter Polidoro
2022-12-07 21:01 ` Wojtek Kosior via
2022-12-08 10:44 ` zimoun [this message]
2022-12-08 14:21 ` Peter Polidoro
2022-12-08 15:30 ` Wojtek Kosior via
2022-12-08 18:47 ` zimoun
2022-12-08 21:30 ` Wojtek Kosior via
2022-12-08 23:04 ` zimoun
2022-12-08 23:24 ` Wojtek Kosior via
2022-12-09 17:46 ` Peter Polidoro
2022-12-10 13:21 ` zimoun
2022-12-12 17:55 ` Peter Polidoro
2022-12-12 19:00 ` Wojtek Kosior via
2022-12-09 18:38 ` Philip McGrath
2022-12-07 17:08 ` Wolf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86ilimgop6.fsf@gmail.com \
--to=zimon.toutoune@gmail.com \
--cc=help-guix@gnu.org \
--cc=paren@disroot.org \
--cc=peter@polidoro.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).