[Top][All Lists]

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

Re: more package transformations: overrides

From: Sarthak Shah
Subject: Re: more package transformations: overrides
Date: Fri, 24 Mar 2023 19:35:51 +0530

By separate file or stdin your really mean stdin, correct?  As in:

--8<---------------cut here---------------start------------->8---
guix something < args.txt or
echo "$args" | guix something
--8<---------------cut here---------------end--------------->8---

One note: since this mechanism could be generally useful, it should be
globally available (like 'guix build' options), for any 'guix'
Actually, while using this shell script you could also pass a file directly i.e all of these will work:
./guix-shell-with-args /path/to/some/file-with-args
./guix-shell-with-args < /some/other/file
echo "something from stdin" | ./guix-shell-with-args
If needed we could modify the script to only accept a file when a flag like --read-args-from-file is passed. It's a proof of concept, and I think some more work would need to be put in for actually implementing it since there are probably a whole class of possible bugs and errors that we have not considered.
I agree that it could be beneficial to all guix subcommands; I can see myself using it with `guix package` for example. In this case we could perhaps have a subcommand `guix with-args <subcommand>` which lets you invoke <subcommand> (install, package, build etc) with arguments from stdin or (optionally) a file.

At this point, we have a real Scheme API we can use :-).  If there's a
problem with using that, we should work toward improving it.

 Yes, on further deliberation I realized that I'm basically writing a DSL atop manifests   ^_^"

If more people see a use for this suggestion, I could try writing a more polished shell script for `guix with-args`

Happy Hacking!

reply via email to

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