Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: ZQL – a language for *declaring* scripts content. Any ideas for changes maybe?



On Tue, Jul 23, 2019 at 01:50:56PM -0700, Bart Schaefer wrote:

> On Mon, Jul 22, 2019 at 9:28 AM Sebastian Gniazdowski
> <sgniazdowski@xxxxxxxxx> wrote:
> >
> > when I once tried NixOS, a system with declarative configuration at
> > its core, i was naively expecting that I'll be able to declare zshrc.
> > So, for example, that I'll be able to write some kind of rule "append
> > command {X} to the end of the zshrc if it's not somewhere in the
> > file".
> 
> You should have a look at the "newuser" module and zsh-newuser-install
> function, also at Functions/MIME/zsh-mime-setup and
> Completion/compinstall ... these all implement something or other of
> the sort.  The general approach is to mark off sections of the file(s)
> with keyworded comments and then restrict the operation of the
> "declaration" routines to the corresponding commented sections.
> 
> There's probably a lot of recent stuff that could be added to at least
> newuser and compinstall.

IMO, it would make sense to just install files in a directory and only have
.zshrc source them all (either using a well-known ordering mechanism or
implement some fancier dependency system).  Then you don't need a brittle
mechanism to edit (multiple times, and then to maintain the lifecycles of those
edits) a file that's nominally under user control, other than to insert a single
line.

Danek



Messages sorted by: Reverse Date, Date, Thread, Author