Skip to content
This repository has been archived by the owner on Nov 7, 2024. It is now read-only.

Implement nuenv.writeShellApplication #27

Merged
merged 2 commits into from
Nov 7, 2024

Conversation

hallettj
Copy link
Contributor

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.

@lucperkins
Copy link
Member

@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.

Copy link

@srid srid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to have an example as well, especially one that takes CLI arguments from the user and passes it to a Nu function.

We can even make it an useful one. For example, runtimeInputs = with pkgs; [ fzf curl jq ] - and then display some GitHub repo info on the terminal.

@hallettj
Copy link
Contributor Author

@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?

@lucperkins
Copy link
Member

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

@lucperkins
Copy link
Member

@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 lucperkins merged commit 7c51428 into DeterminateSystems:main Nov 7, 2024
3 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants