Ni

NixSH, run Bash/Python or any scripts with the power of Nix

Hacker News

NixSH, run Bash/Python or any scripts with the power of Nix

Hello HN! I had to work with a codebase that was full of magic environment variables and tons of bash scripts, which was and still is a nightmare. I decided to try and make a solution using NIX, which ended being far more easy to work with and I think that brings a lot of value. This is: https://github.com/Rucadi/nixsh Some examples can be found on the readme but a more advanced example can be seen here: https://github.com/Rucadi/nixsh/blob/master/examples/nixsh/c... Here's a glimpse of what the solution offers: - Precise control over environment variables, ensuring only the necessary ones are accessible when executing any script. - Ability to set default values for environment variables - Ability to dynamically manipulate environment variables directly from NIX expressions. - Using nix to eliminate the need for manual installation of dependencies before script execution. - Integration of disparate components like bash scripts and programs in C++, Rust, or Python, facilitating cohesive scripting. - Leveraging NIX as a preprocessor for any file, for example, you can generate code using nix, and compile it before the execution runs automatically. - Compile-Time checking of existence of files and envars - Full interoperability, since you end up executing bash/python in the end, with the benefit that nixsh will already have cleaned your environment :) The current implementation involves parsing NIX code using tools like awk and sed to strategically inject components where needed. While this proof of concept serves its purpose. I think it's a cool program and I think that I will use from now on, I'm 100% open to contributions if you feel like it :)

Share card

Actual performance

2points
Did not reach leaderboard

Launch Intel predictions

Analyze your own launch →
Indie HackersFits the IH revenue-focused audience · Strong signals: para · Missing: supports, reddit linkedin, podcasting
86%86% predicted probability of success on Indie Hackers, based on ML models trained on real launch data.
best fitHighest predicted score across all platforms for this description.
Product HuntOn track for Day 1 leaderboard · Strong signals: using, code, open · Missing: mac, agents, macos
69%69% predicted probability of success on Product Hunt, based on ML models trained on real launch data.
AppSumoStrong fit for a featured deal · Missing: plus, platform, intuitive
56%56% predicted probability of success on AppSumo, based on ML models trained on real launch data.
Hacker NewsMay not resonate with HN audience · Strong signals: exist, ide, io · Missing: https docs, excited, just released
44%44% predicted probability of success on Hacker News, based on ML models trained on real launch data.
nativeThis product was originally launched on this platform.
TrustMRRLess likely to generate early MRR · Strong signals: para · Missing: mobile apps, ios, personal
38%38% predicted probability of success on TrustMRR, based on ML models trained on real launch data.
Acquire.comPre-revenue stage for this audience · Missing: arr, mrr, revenue
13%13% predicted probability of success on Acquire.com, based on ML models trained on real launch data.
BetaListMay not resonate with beta-testers · Missing: web3, chat, crypto
0%0% predicted probability of success on BetaList, based on ML models trained on real launch data.

Correct prediction on native model

Similar products

Re
Redis Lua scripts as typed Python functions75%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Redis Lua scripts as typed Python functions

Hacker News1
Be
Bebo – run Clojure scripts on Deno60%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Bebo – run Clojure scripts on Deno

Hacker News48
Ru
Run Python Scripts via Slack slash commands54%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Run Python Scripts via Slack slash commands

Hacker News3
Wo
Worker Bee – Free app to share and run Python scripts46%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Worker Bee – Free app to share and run Python scripts

Hacker News20
Wo
Wolverine: Give your Python scripts regenerative healing abilities69%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Wolverine: Give your Python scripts regenerative healing abilities

Hacker News43
Sh
Shmux – run all your scripts from one file44%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Shmux – run all your scripts from one file

Hacker News26
He
Hexora – detection and analysis of malicious Python scripts53%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Hexora – detection and analysis of malicious Python scripts

Hacker News3
Wo
Wooey Web UIs for Python Scripts57%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Wooey Web UIs for Python Scripts

Hacker News1
Sc
Scripts for Trello53%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Scripts for Trello

Hacker News19
mr
mruby-rake, compile your ruby scripts to mruby executable56%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

mruby-rake, compile your ruby scripts to mruby executable

Hacker News3