Skip to content

Instantly share code, notes, and snippets.

@m-triassi
Created July 23, 2025 03:46
Show Gist options
  • Select an option

  • Save m-triassi/b4d7a437468ba069a65d7e12b8de870e to your computer and use it in GitHub Desktop.

Select an option

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.
#!/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