[HN Gopher] Nuenv: An experimental Nushell builder for Nix packages
___________________________________________________________________
Nuenv: An experimental Nushell builder for Nix packages
Author : biggestlou
Score : 64 points
Date : 2023-03-28 15:01 UTC (7 hours ago)
(HTM) web link (determinate.systems)
(TXT) w3m dump (determinate.systems)
| Arcuru wrote:
| I'm kind of surprised this didn't link to the Nix RFC that
| considers changing the default builder from Bash to Oil:
| https://github.com/NixOS/rfcs/pull/99
|
| Of course it does have a different goal (of replacing Bash with
| OSH instead of only offering an alternative), but it has a lot of
| good discussion.
|
| Personally I think having alternative builders available is a
| great idea to improve the developer experience here.
| ofchnofc wrote:
| [dead]
| pxc wrote:
| This kind of thing has been on my fantasy wishlist for Nix for a
| long time. I am so glad to see experiments like this being done
| at a company that is dedicating resources to the Nix ecosystem
| with the potential to rapidly follow through if they see
| something valuable there.
|
| With so many fruitful experiments in the Nix ecosystem being
| carried out by people who can dedicate more time to Nix than
| ever, I increasingly feel like I'm wasting my life by not
| seriously working on or with the Nix ecosystem as my main daily
| occupation.
|
| I know there are still unresolved difficulties and growing pains,
| but _later_ seems like such a stupid time to really dive in, for
| people who already know Nix and are already excited about it.
| SkyMarshal wrote:
| I use NixOS as my daily driver on my two workstations, and
| package manager on my Mabook Pro now.
|
| It's super helpful if you have an extra computer you can
| reformat and spend a couple months experimenting with NixOS on,
| learning it, getting it set up just right, and verifying it can
| do everything you need your main OS to. Nix is great for this
| kind of rapid experimental iteration with system config, since
| if something doesn't work you either quickly fix it and make a
| new build, or just roll back to the prior working build.
|
| The beauty of Nix is, if that succeeds, the declarative config
| can instantly apply it to your other computer/s too, and fully
| transition with minimal risk. Then you can use multiple Nix
| computers in a sort of A-B testing setup, where you test new
| config options on one till they work, and copy them over to the
| others only after you're certain they're ready. Repeat.
|
| And if the initial experiment with it doesn't work out for any
| reason, you still have your non-Nix computer chugging along
| doing all the things you need it to do.
| amelius wrote:
| Yes, but if it doesn't work there's an indirection between
| you and the actual problem. Which feels like having to use
| chopsticks to build a Lego project.
| SkyMarshal wrote:
| How do you mean? I ran into a number of problems back when
| learning NixOS, but the error messages were usually
| sufficient to track them down.
| ParetoOptimal wrote:
| I'm very happy alternative builders such as nushell and Nickel
| are being worked on.
|
| Even happier that concurrently the other side of Nix DX that is
| documentation is very actively being worked on.
| biggestlou wrote:
| Apologies for my "well, actually" pedantry but Nickel is a
| type-safe alternative to Nix for creating expressions and, as
| far as I know, not a builder. _But_, that being said, there's
| indeed a lot of fun areas to explore here that, with enough
| work and care, could be pretty transformative.
| pxc wrote:
| Maybe with the effects system Nickel itself could actually be
| used as a builder as well as the expression language,
| although I don't think that's really the intent atm.
| dlahoda wrote:
| default links bash with well know linter and one may make bash or
| cp other bash into nix and tune. also with nix it is easy to add
| alternative cli tools like sad, rg, etc.
|
| if i want to be heavy and code real stuff, in nix it is easy to
| build and run any language. many things people do in bash to
| glue, i glue using nix declaratively.
|
| so imho until other alt shell wins without nix, will use ugly
| weird non scalable bash.
| scns wrote:
| Thanks for mentionind sad, didn't know it yet. To save others a
| search: https://github.com/ms-jpq/sad
|
| Space Age seD
| eviks wrote:
| Nice to see an alternative to dealing with bash, though was
| wondering why a shell based on a proper language like python
| wasn't considered
| biggestlou wrote:
| I know that Python builders do exist out there. Personally,
| I've found Nushell much more concise than Python et al and
| quite adequate for the task at hand. But who knows, maybe I
| should do a whole series :)
| 0x69420 wrote:
| i do not want my shell to depend on whatever idea of package
| management python has this week, nor do i necessarily want to
| warm up the jit of a ~proper~ general-purpose scripting
| language in the process of execing a one-line script
| pxc wrote:
| Because the _main_ business of most Nix builders is shelling
| out to external programs, and for that there isn 't anything
| that's a better fit than a shell language.
|
| At the same time, the whole mission of these next-gen shell
| languages (Nushell, Elvish, Oil, Crush, Murex, NGS) is to
| provide a language that is at once a shell language suitable
| for daily interactive usage _and_ a capable, general purpose
| programming language in its own right.
|
| Truthfully, I don't think a better fit exists for this use case
| than one of these shell languages.
| eviks wrote:
| But Python is also a shell language suitable for daily
| interactive usage, e.g., within a python-based shell called
| xonsh, so the naming alone doesn't explain much re. which of
| the next-gen shell languages are better suitable
| pxc wrote:
| Imo if you spend a little while using a shell like Xonsh or
| Ammonite, it becomes clear why the internal DSL approach is
| not as suitable for this as a new language that is designed
| with interactive shell usage in mind from the start.
| (Lisp-y languages might be a bit of an exception since
| command invocations are very close to the same thing
| syntactically anyway. But idrk since I've never tried using
| an internal DSL in a Lisp as a Unix shell.)
|
| But sure, some people do use and love Xonsh, and you could
| make the case for using a Xonsh builder in this way as
| well.
| pasc1878 wrote:
| For an better shell language that also allows extension in
| python see xonsh
___________________________________________________________________
(page generated 2023-03-28 23:00 UTC)