NixSH, run Bash/Python or any scripts with the power of Nix
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 cardActual performance
Launch Intel predictions
Analyze your own launch →Correct prediction on native model
Similar products
Redis Lua scripts as typed Python functions
Bebo – run Clojure scripts on Deno
Run Python Scripts via Slack slash commands
Worker Bee – Free app to share and run Python scripts
Wolverine: Give your Python scripts regenerative healing abilities
Shmux – run all your scripts from one file
Hexora – detection and analysis of malicious Python scripts
Wooey Web UIs for Python Scripts
Scripts for Trello
mruby-rake, compile your ruby scripts to mruby executable