Re: Using Makefile to run guix shell?

2022-12-07 Thread Wojtek Kosior via
> > Why not just do:
> >
> >   guix shell -- make metadata
>
> I do like the idea of not making it depend on guix.
>
> One of the things I am trying to avoid, though, is typing long
> guix commands.
>
> When I type "make guix-shell", what I really want is something
> like:
>
> guix-shell:
>   guix time-machine -C channels.scm -- shell --pure --check -m 
>   manifest.scm
> 
> Or if I am doing embedded work I might want type "make 
> serial-shell" to do something like:
> 
> serial-shell:
>   guix time-machine -C channels.scm -- shell -m manifest.scm 
>   --container --expose=$(PORT) picocom -- picocom -b 9600 -f n -y 
>   n -d 8 -p 1 -c $(PORT)
> 
> I guess I am just curious how other people manage such long 
> commands?
>

I recently came up with the same solution as you[1][2] :)

I haven't considered hard requirement on Guix a major issue. But I did
for a moment think about another solution to the same problem. I
believe it'd be possible to use a mere shell script instead of
a Makefile. Or a mere guile script or Python script (setup.py on
steroids?) :)

Wojtek

[1] https://git.koszko.org/pydrilla/
[2] https://git.koszko.org/koszko-org-server/


-- (sig_start)
website: https://koszko.org/koszko.html
PGP: https://koszko.org/key.gpg
fingerprint: E972 7060 E3C5 637C 8A4F  4B42 4BC5 221C 5A79 FD1A

Meet Kraków saints!   #21: saint Kazimierz
Poznaj świętych krakowskich!  #21: święty Kazimierz
https://pl.wikipedia.org/wiki/Święty_Kazimierz
-- (sig_end)


pgpuMGKlrnLqa.pgp
Description: OpenPGP digital signature


geiser doesn't like guix repl

2022-12-07 Thread (
Heya,

When I run ``guix repl --listen=tcp:37146 &'', then ``M-x geiser-connect'' in
Emacs, and run ``,use (gnu packages irc)'' or ``,use (gnu)'', I get this 
message:

  While executing meta-command:
  In procedure manifest-entry-name: Wrong type argument: #< 
name: "guix" version: "dfc6957" output: "out" item: 
"/gnu/store/wn0kz4g6h2rbxs52lrv3ml9w8430xp5g-guix-dfc6957a5" dependencies: () 
search-paths: () parent: #> properties: ((source (repository (version 0) (url 
"https://git.savannah.gnu.org/git/guix.git;) (branch "master") (commit 
"dfc6957a5af7d179d4618eb19d4f555c519bc6f2") (name guix) (introduction 
(channel-introduction (version 0) (commit 
"9edb3f66fd807b096b48283debdcddccfea34bad") (signer "BBB0 2DDF 2CEA F6A8 0D1D  
E643 A2A0 6DF2 A33A 54FA"))>

And if I try again, there are no errors, but:

  > irssi
  ice-9/boot-9.scm:1685:16: In procedure raise-exception:
  error: irssi: unbound variable

And if I try ``,use (gnu)'':

  In procedure allocate-struct: Wrong type argument in position 1 (expecting 
struct): #>

What's going on!? :(

-- (


signature.asc
Description: PGP signature


Re: Using Makefile to run guix shell?

2022-12-07 Thread Peter Polidoro




Why not just do:

  guix shell -- make metadata


I do like the idea of not making it depend on guix.

One of the things I am trying to avoid, though, is typing long 
guix commands.


When I type "make guix-shell", what I really want is something 
like:


guix-shell:
 guix time-machine -C channels.scm -- shell --pure --check -m 
 manifest.scm


Or if I am doing embedded work I might want type "make 
serial-shell" to do something like:


serial-shell:
 guix time-machine -C channels.scm -- shell -m manifest.scm 
 --container --expose=$(PORT) picocom -- picocom -b 9600 -f n -y 
 n -d 8 -p 1 -c $(PORT)


I guess I am just curious how other people manage such long 
commands?




Re: Using Makefile to run guix shell?

2022-12-07 Thread (
Heya,

On Wed Dec 7, 2022 at 3:26 PM GMT, Peter Polidoro wrote:
> metadata:
>   $(GUIX-CONTAINER) -- sh -c "emacs --batch -Q  -l .init.el --eval 
>   '(process-org \".metadata.org\")'"

Why not just do:

  guix shell -- make metadata

? That way, people without Guix installed can use it, too.

-- (


signature.asc
Description: PGP signature


Re: Using Makefile to run guix shell?

2022-12-07 Thread Peter Polidoro
And then all you need to do is run ``guix shell'', and it will 
automatically

pick up that manifest or package file.


That works well for just the "guix shell" command, but what if I 
want shortcuts to a whole set of commands?


For example, I might want a command to automatically generate 
project metadata from an org file running "make metadata":


metadata:
	$(GUIX-CONTAINER) -- sh -c "emacs --batch -Q  -l .init.el --eval 
	'(process-org \".metadata.org\")'"


This seems to work well, but I just wondered if putting a Makefile 
into every project root may cause conflicts for some build 
systems.


Is there something better to use than make for such command 
shortcuts?




Re: Using Makefile to run guix shell?

2022-12-07 Thread (
Heya,

On Wed Dec 7, 2022 at 2:47 PM GMT, Peter Polidoro wrote:
> Is it considered bad practice to use make like this? Is there a 
> better way to do something similar?

All you need to do is have a ``guix.scm'' or ``manifest.scm'' in your project
directory, then add it to the ``guix shell'' authorised directories:

  echo $PROJECT_DIR >> ~/.config/guix/shell-authorized-directories

And then all you need to do is run ``guix shell'', and it will automatically
pick up that manifest or package file.

-- (


signature.asc
Description: PGP signature


Using Makefile to run guix shell?

2022-12-07 Thread Peter Polidoro
In the root of every project directory, I now include a 
channels.scm file and a manifest.scm file.


I was using direnv to automatically launch guix shell, but I 
wanted more flexibility to easily launch variations of guix shell.


Now I am also including a Makefile in the root of every project 
directory so I can use "make guix-shell" or "make guix-container" 
or "make project-documentation" etc to quickly run commands.


This works well for certain types of projects, but there could be 
conflicts with projects that expect or automatically generate 
their own Makefiles.


I could use a different Makefile name for my guix commands, but 
that makes my commands less convenient to type.


Is it considered bad practice to use make like this? Is there a 
better way to do something similar?




Re: Persistent environment variable

2022-12-07 Thread Reza Housseini

On 12/5/22 22:35, Tobias Geerinckx-Rice wrote:

So what's the variable?


It is in fact a bashrc files which defines several variables.
It is kind a crude way of doing things and I did not found any other 
software which has a similar setup in the repository. But without 
sourcing this file you cannot do a lot when using this software (openfoam).


Cheers,


--
Reza Housseini

This message is signed with my GnuPG key:

C0F3 0812 9AF2 80F4 0830 C2C1 C375 C6AF 0512 5C52



OpenPGP_0xC375C6AF05125C52.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


Re: This is how you import a mailing list archives (e.g. guix-patches) into mu4e

2022-12-07 Thread zimoun
Hi Kyle,

On Tue, 06 Dec 2022 at 21:02, Kyle Meyer  wrote:

> I haven't used it myself (unsurprisingly I have an interest in keeping
> yhetil.org's inboxes replicated on my local machine), but I think you
> can keep grokmirror clones shallow by hooking up its grok-pi-piper to
> the post-update hook. Here's a relevant bit from grokmirror's docs:
>
> --8<---cut here---start->8---
> [DEFAULT]
> # To start piping public-inbox messages into your inbox, simply
> # install procmail and add the following line to your ~/.procmailrc:
> # DEFAULT=$HOME/Maildir/
> # You can now read your mail with "mutt -f ~/Maildir/"
> pipe = /usr/bin/procmail
> # Once you've successfully piped the messages, you generally
> # don't need them any more. If you set shallow = yes, then
> # the repository will be configured as "shallow" and all succesffully
> # processed messages will be pruned from the repo.
> # This will greatly reduce disk space usage, especially on large archives.
> # You can always get any number of them back, e.g. by running:
> # git fetch _grokmirror master --deepen 100
> shallow = yes
> --8<---cut here---end--->8---

Cool!  I will give a look and report if I am happy with it. :-)

Cheers,
simon



Re: This is how you import a mailing list archives (e.g. guix-patches) into mu4e

2022-12-07 Thread zimoun
Hi,

On Wed, 07 Dec 2022 at 02:27, Mekeor Melire  wrote:

>   I should go and find that old thread in the
> guix-sysadmin list.

This list guix-sysadmin is a private aliases, I guess.  Maybe it could
be worth to start a new thread in guix-devel.

Cheers,
simon