nuenv icon indicating copy to clipboard operation
nuenv copied to clipboard

Implement nuenv.writeShellApplication

Open hallettj opened this issue 1 year ago • 4 comments

Hi Luc! It's been a while! I enjoy reading your posts on nix when I come across them. I fully agree about the benefits of writing scripts in nushell. I was looking around for a nushell equivalent of writeShellApplication, and that lead me to your work on nuenv. I saw that you already have an analog of writeScriptBin. That's close, but not quite what I had in mind. So I thought I would contribute my own writeShellApplication implementation. It works almost just like the version in nixpkgs but of course it uses nushell, and instead of shellcheck it checks scripts with nu-check.

hallettj avatar Jul 12 '24 05:07 hallettj

@hallettj Love it! And great to hear from you, of course 😄 I'm so glad that you've been benefiting from our work. I actually recently stole one of your approaches helping another project out (though with proper attribution!). A writeShellApplication function for Nuenv is quite welcome.

I've lapsed a bit and let Nixpkgs get woefully out of date. Could you run nix flake update and push to this PR? If that breaks something, let me know and I'll make whatever changes are required.

lucperkins avatar Jul 12 '24 06:07 lucperkins

@lucperkins Oh I love that you're making use of that post! And yes, I'll update the flake inputs.

@srid Sounds good, I'll put in an example. I'm not sure how to incorporate fzf. Maybe something like show a list of PRs to view info for?

hallettj avatar Jul 12 '24 18:07 hallettj

@hallettj Don't worry about providing an example. I'll provide one as a follow-up 😄

lucperkins avatar Jul 12 '24 18:07 lucperkins

@hallettj I just checked locally and it looks like upgrading Nixpkgs won't be so smooth. I'm going to get that worked out on my side and I'll let you know.

lucperkins avatar Jul 12 '24 18:07 lucperkins