Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add nom run #110

Open
takeda opened this issue Sep 3, 2023 · 4 comments
Open

add nom run #110

takeda opened this issue Sep 3, 2023 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@takeda
Copy link

takeda commented Sep 3, 2023

Is there a reason why nix run does not have equivalent in nom?

I'm able to use: nix run --log-format internal-json .#docker.copyToDockerDaemon |& nom --json and it seems to work.

@maralorn
Copy link
Owner

maralorn commented Sep 3, 2023

The problem is, that once nix finishes fetching or building the program it starts running it. And then piping stdout and stdin through nom is most likely not what you want. Imagine how broken this would be if you do nom run nixpkgs#htop. So we need a way to determine that nix has finished so that we can somehow switch into pass-through mode. This is the same problem as with nix shell and nix develop and I don’t know if there is a good solution for this.

@maralorn maralorn added enhancement New feature or request help wanted Extra attention is needed labels Sep 3, 2023
@takeda
Copy link
Author

takeda commented Sep 4, 2023

I see, I mostly use it with https://github.com/nlewo/nix2container and current output is good enough.

@Atemu
Copy link

Atemu commented Apr 7, 2024

A not very clean but simple solution would be to translate the nom run ... to nom build ... --no-link) and then exec into nix run ... at the end.

This way all output paths are cached and nix run would only need to eval. The only slight issue would be that eval would only be cached with flakes, so you'd eval twice but that's quite a bit better than no nom run at all.

@maralorn
Copy link
Owner

maralorn commented Apr 7, 2024

Or we go bold and try to mirror the eval which nix run does with nix shell and then execute the process in the shell. I guess if one looks a while hard at the implementation of nix run it won’t be to hard to find a passable solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants