[Nix-dev] args: with args
Marc Weber
marco-oweber at gmx.de
Tue Mar 11 09:23:55 CET 2008
Hi Armijn,
about args: with args
> in the top level file and twice in the other Nix expression. The "args:
> with args" construction would just weed out one occurence but force me
> to look at the top level file to see what the parameters were again. So,
No, you don't have to go to the top leve directory. You can also use an
editor of choice and do a quick search with highlight within the file.
Then you'll see at a glance wether an arg has been defined locally or
outside.
It would be really ugly when using
all_packages = ...
xy = import a/b { flags = ... } // all_packages :)
> Could someone please convince me why this is an improvement?
May I ask the other way round :
Could someone please convince me that it's really more ugly than has
been?
Why do you have to spend much effort on switching between the top-level
(all-pacakges.nix) file and the builder (args; with args) file?
Can you tell me more about how / when you are browsing / reding nix
files and when this args; with args hurts you most (in which use/ code
reading case?)
For instance I've mapped all-packages to a key combination within vim.
Then I place my coursor on a path and press gf and I'm there. To get
back to all-packages.nix I just press m-#. That's it. Not much effort.
But that has a down side as well: I do no longer care that much about
directory layout and I should (eg nix_repository_manager should have
been nix-repository-manager in the first place etc..)
I've started using args; with args because I'm lazy. This means when
adding a new expression I start only with meta and src (maybe some
dependencies I already know). Then I watch the configure output and at
dependencies when I need them (but only twice).
> Bigger scope: right now there are quite a few different styles that are
> used to make expressions.
I only know about three, maybe we can put them on a wiki with some
explanation why they have introduced and which benefits they offer?
If the expression has been written by me you can just ask me to reduce
the brain power you need. I'm often online on irc. Just ask.
In this case I can only speak about mkDerivationByConfiguration.
I've added a small comment to just ask me. Maybe you can give me some
feedback about wether you think this is good practise?
> To be honest, I'm not too happy with that
> either. It looks messy and it is confusing, since it needs quite a few
> brain twists on my side to see what is going on.
Do you have a suggestion how to improve this situation or can you ask
the authors directly ? Feedback is the best way to improve things IMHO.
That's why I think it's good that you've written this mail.
BTW: We've also some really basic ctags support for nix (using regex)
But I don't have need for it.
Thank you for any feedback converning my code/ changes whatsoever.
Sincerly
Marc Weber
More information about the nix-dev
mailing list