Created
July 23, 2025 03:46
-
-
Save m-triassi/b4d7a437468ba069a65d7e12b8de870e to your computer and use it in GitHub Desktop.
Create shells scripts on NixOS without ever having to install its dependencies.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env nix-shell | |
| #!nix-shell -i bash -p cowsay fortune | |
| ## NixOS' nix-shell can be used as a shebang to then load in dependencies for the script without ever having to install them. | |
| # This executes as expected, albeit a bit more slowly at start up to load in the dependencies | |
| fortune | cowsay |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment